I think a boolean is a good indicator for whether the operation was
honored or not.

Paul

On Tue, Sep 20, 2011 at 11:41 PM, Gary Gregory <garydgreg...@gmail.com> wrote:
> On Wed, Sep 21, 2011 at 12:09 AM, Phil Steitz <phil.ste...@gmail.com> wrote:
>
>> On 9/20/11 8:24 PM, Gary Gregory wrote:
>> > That sounds reasonable.
>> >
>> > Would any call sites prefer an exception. Checked or unchecked?
>>
>> I suppose in some cases some clients / pool implementations might
>> want to throw IllegalStateException if an attempt is made to add to
>> a pool at capacity, but there are others (including internal to GOP,
>> GKOP) where it is more convenient for it to be a no-op.  Checking a
>> boolean return or just allowing the no-op is lighter weight than
>> catching an exception, so the boolean return is probably better.
>> Implementations that want to throw can document and throw unchecked
>> exceptions (e.g. ISE) and clients can also throw on the false return
>> if they want.
>>
>
> Well, it sounds like the KISS solution is the boolean. I'd say go for that
> until something better is needed.
>
> Gary
>
>
>> Phil
>> >
>> > Gary
>> >
>> > On Tue, Sep 20, 2011 at 10:53 PM, Phil Steitz <phil.ste...@gmail.com>
>> wrote:
>> >
>> >> When GKOP or GOP pools lack capacity, addObject does nothing.  In
>> >> some cases (I am dealing with one now internally to GKOP), it would
>> >> be good to know if an instance was actually added or not.  How about
>> >> changing the interface (both OP and KOP versions) to return a
>> >> boolean with true indicating that a new instance was actually
>> >> created and added to the pool?
>> >>
>> >> Phil
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
>> >> For additional commands, e-mail: dev-h...@commons.apache.org
>> >>
>> >>
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
>> For additional commands, e-mail: dev-h...@commons.apache.org
>>
>>
>
>
> --
> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
> Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to