Stefano Bagnara wrote:

> Considering that the newName method is currently called only during the 
> creation of a new MailImpl object I think that a third solution would
> be better.

This is just using a constructor instead of the duplicate() call.  But OK.

> We don't use the duplicate because we can't assume the originalMail is a 
> MailImpl as the contract is that we receive a Mail object.

Well, then duplicate(...) is pretty useless.  :-)

> Add a constructor to MailImpl:
> public MailImpl(Mail original) that simply create a newName
> and then calls this(original, newName(original));

MailImpl(Mail) should not create a new name.  If we want to use the contructor 
approach, go with the same pattern:

        MailImpl(Mail orig) { this(orig, false) }
     MailImpl(Mail orig, boolean newName) { ... }

Work for you?

        --- Noel



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to