Sounds good. Is this also something to add to our coding standards?

cheers,

- Leo

On Sun, 2002-11-10 at 03:57, Peter Donald wrote:
> Hi,
> 
> I found some code in Fortress (specifically ContextBuilder) that uses 
> chaining. ie code can look something like
> 
> ContextBuilder cb = ...;
> 
> cb.doX().doY().doZ();
> 
> Because all the methods return this. In many cases this is considered a 
> problem because it hides problems relating to;
> * synchronization
> * resource management
> etc.
> 
> While those don't cover our situation I still consider it a bad practice 
> because mutators/accessors should be sideeffect free IMO. WOuld anyone object 
> if I made all those methods not return this? So the code would end up looking 
> like
> 
> ContextBuilder cb = ...;
> 
> cb.doX();
> cb.doY();
> cb.doZ();




--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@;jakarta.apache.org>

Reply via email to