On Sat, 2 Feb 2002 00:37, Berin Loritsch wrote:
> Peter Donald wrote:
> > On Fri, 1 Feb 2002 09:17, Berin Loritsch wrote:
> >
> > Anyways if you get a chance checkout
> > proposal/myrmidon/src/java/org/apache/myrmidon/component/role
> > proposal/myrmidon/src/java/org/apache/myrmidon/component/type
>
> The time, the time... 

:)

> (Speaking of which did you get my message I sent to
> you off list?)

Maybe ... still got 82 unanswered emails in my non-list, non-spam mailbox :)

> > I have an xpool package that I use for this that I could integrate into
> > mpool if it is compatible. However my xpool is mainly for managing
> > passive objects (ie. chunks of memory, packets, formatter objects) which
> > don't have any "lifecycle" as such. Would this fit in with what you are
> > doing with mpool?
>
> Probably.  I still have a root ObjectFactory that can handle the process of
> making any object with the newInstance() method.  The big difference is the
> asynchronous manager (or if no CommandManager is pressent--no management). 
> I only have a really simple manager for the pool interface.
>
> Question:
>
> How do you feel about making the external pool interface more like the
> ThreadLocal interface?  The ThreadLocal Interface is like this:
>
> ThreadLocal
> {
>      public getObject()
>      protected newObject()
>      public setObject()
> }
>
> :/  Then again, I say we ought to KISS:
>
> Pool
> {
>      Object get();
>      void put( Object ); // although return does speak louder as to its
> purpose }

I actually prefer the aquire() / release() terminology - maybe I worked with 
MS technology for too long ;)

However either interface is acceptable. If the pool was like ThreadLocal then 
we would have a single pool per type and we would likely have a base class 
that was extended by users to implement newObject?

So 

class MyFooPool extends MPool
{
  protected Object newObject()
  {
    return new Whazoo();
  }
}

And we could also have a base class that uses delegation to an ObjectFactory? 
I guess that would be kinda sweet. However KISS does dictate that it is the 
simple get/put interface. SO maybe define pool by get/put and then havce 
abstract class look like threadlocal and implement interface.
-- 
Cheers,

Pete

-----------------------------------------------------
First, we shape our tools, thereafter, they shape us.
-----------------------------------------------------

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

Reply via email to