james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Norman Maurer ...@byteaction.de>
Subject Re: [jira] Created: (JAMES-558) MailImpl expose internal representation on getRecipients. This is a bad practice.
Date Sat, 08 Jul 2006 15:04:30 GMT
Am Samstag, den 08.07.2006, 14:07 +0000 schrieb Stefano Bagnara (JIRA):
> MailImpl expose internal representation on getRecipients. This is a bad practice.
> ---------------------------------------------------------------------------------
> 
>          Key: JAMES-558
>          URL: http://issues.apache.org/jira/browse/JAMES-558
>      Project: James
>         Type: Bug
> 
>   Components: James Core  
>     Reporter: Stefano Bagnara
>      Fix For: 3.0
> 
> 
> Currently our getRecipients expose the internal collection and it is used that way.
> To add recipients we use getRecipients().add(), to store multiple times a single mail
to different recipients we get the recipients collection and alter it between store of the
mail object (in RemoteDelivery).
> All of this seems to me bad practice and we should better encapsulate the recipients
list in the mail object.
> Maybe the simple way is to return immutable collections so we'll find bugs as soon as
possible and add methods to add and remove recipients directly in the mail interface.
> 

+1 for adding the methods directly to the MailInterface.

bye
Norman


Mime
View raw message