james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Markus Wiederkehr" <markus.wiederk...@gmail.com>
Subject Re: MIME4J - remove parent reference from Body?
Date Thu, 02 Oct 2008 21:10:00 GMT
On Thu, Oct 2, 2008 at 10:30 PM, Bernd Fondermann <
bernd.fondermann@googlemail.com> wrote:

> I'd prefer a copy constructor, or a CopyUtil.
> Please consider http://en.wikipedia.org/wiki/Clone_(Java_method)<http://en.wikipedia.org/wiki/Clone_%28Java_method%29>


Under different circumstances I would agree with you. But in this case it
does not seem applicable to me because a) only concrete classes can have a
copy constructor and b) a CopyUtil class would require a visitor.

regarding a: Body is an interface - how do you copy Body instances with a
copy constructor?
regarding b: like I said, the set of classes is open for expansion. As I see
it it should be possible to implement the Body interface in a different way.

Maybe a hybrid form would be acceptable? Meaning either a copy constructor
or a visitor for top-level classes such as Message, Multipart and BodyPart
in addition to a copy-method declared in the Body interface..

Markus

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message