Peter,

this is a response to both your emails.

> From: Peter Donald [mailto:[EMAIL PROTECTED]]
> 
> On Sun, 17 Feb 2002 00:41, Leo Sutic wrote:
> > > From: Peter Donald [mailto:[EMAIL PROTECTED]]
> > >
> > > > And this is where I disagree - not having remove requires the client
> > > > to know about implementation details such as whether a component
> > > > is thread safe or not, whether it is pooled or not.
> > >
> > > no it doesn't. It implies that the container has to manage resource
> > > allocation and deallocation.
> >
> > It also implies that CM == container (as it does not expose any method for
> > releasing resources) && all requests come in through the CM (otherwise
> > it can not know when a request starts/ends), which is not true.
> 
> Thats not the conclusion I would draw - espcially considering all the 
> architectures that I have developed separate the notion of CM and 
> kernel/container (see Phoenix for an example) and those that do support 
> pooling do it transparently to the user - without the user even 
> knowing that a certain resource is poolable.

But how is this done?

Suppose we have:

interface ComponentManager {
  Component lookup (String role);
}

and we have a container

class Container {
  ComponentManager manager;
}

that passes on requests to

interface RequestHandler {
  void handle (Request req);
}

Now, how does the Container tell the CM to release components that
the RequestHandler used in handle(Request)?

Should it be:

interface ContainerComponentManager extends ComponentManager {
  void release (Component component);
}

class Container {
  ContainerComponentManager manager;
}

The thing I do not see how it works is: How can the container, unless
it knows more about the CM than what the release-less interface provides,
release components?

Also, how do you handle the case when you have a component that uses 
a pooled resource, but is rarely used?

For example:

class SeldomlyUsedComponent implements Poolable {

  DBConnection connection;

  public doThis () {
    connection.x ();
  }
}

Should SeldomlyUsedComponent lookup the connection in doThis, and in 
that case, who manages the per-request CM management?

If SeldomlyUsedComponent does a lookup in compose(), you have components
sitting on scarce resources unneccesarily.

/LS


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

Reply via email to