> From: Peter Donald [mailto:[EMAIL PROTECTED]]
>
> On Sun, 17 Feb 2002 04:58, Leo Sutic wrote:
> > 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)?
>
> Look at phoenix or alternatively it could look like this.
>
> class Container {
> HashMap components;
> }
>
> class ContainerComponentManager implements ComponentManager {
> }
>
> > 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?
>
> The CM is just a facade about the underlying store in the
> container - you can
> provide whatever mechanisms you want by putting a lil logic in the CM.
But then it is as I said - the CM is the container, and the request must
come in through the CM. Then the container isa CM, not container hasa CM.
> public doThis( Request r ) {
> ((DBConnection)r.getComponentManager().lookup( DBConnection.ROLE )).x();
> }
Ugly - requires a framework-level Request object and different interfaces
for static/per-request usage for each component.
/LS
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>