You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Tom Muldoon <to...@firstbest.com> on 2007/04/11 16:02:07 UTC

[pool] returnObject question

In returnObject(), can I discard the current object and construct a new 
one? The reason that I ask has to do with the fact that resetting the 
current object to its initial state is significantly longer than simply 
constructing a new object.

Thanks, Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [pool] returnObject question

Posted by Rodrigo Canabrava <ca...@gmail.com>.
Then probably you don't need a pool.
A pool is useful exactly when you want to re-use the object, for performance
issues.
In your case, seems like you need a factory, not a pool.

Rodrigo


2007/4/11, Tom Muldoon <to...@firstbest.com>:
>
> In returnObject(), can I discard the current object and construct a new
> one? The reason that I ask has to do with the fact that resetting the
> current object to its initial state is significantly longer than simply
> constructing a new object.
>
> Thanks, Tom
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>