You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Berin Loritsch <bl...@apache.org> on 2001/02/21 15:14:04 UTC

[Fwd: Proposed addition to ComponentManager/Selector]


-------- Original Message --------
Subject: Proposed addition to ComponentManager/Selector
Date: Wed, 21 Feb 2001 09:07:33 -0500
From: Berin Loritsch <bl...@apache.org>
Reply-To: "Avalon Development" <av...@jakarta.apache.org>
To: "avalon-dev@jakarta.apache.org" <av...@jakarta.apache.org>

One thing we have identified at the Cocoon porject is the
need to hide the implementation facts of whether a Component
is ThreadSafe, Poolable, Factory, etc.

To date, in order to do that we have had to come up with an
inelegant Hack.

The truly elegant and IMO correct way of doing things is to
add a put() or return(Component) method so that every used
Component has a definite beginning and ending.  It is a standard
contract for all Composers to lookup and return components,
that way the implementation details can be absolutely hidden
from the end client of the Component.

interface ComponentManager {
    Component lookup (String role);
    void return (Component usedComponent);
}

interface ComponentSelector implements Component {
    Component select (Object hint);
    void return (Component usedComponent);
}

This request comes from _hard_ _use_ of the ComponentManager
system, and I think reflects a natural evolution that we
should use.

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

Re: [Fwd: Proposed addition to ComponentManager/Selector]

Posted by Peter Donald <do...@apache.org>.
Hi,

yer I guess it is a bit of a PITA to work with ;) I wouldn't mind if we
used the method name "release" as that is what is used in other object
models (ie usually there is a pair - aquire/release)



At 09:14  21/2/01 -0500, Berin Loritsch wrote:
>
>
>-------- Original Message --------
>Subject: Proposed addition to ComponentManager/Selector
>Date: Wed, 21 Feb 2001 09:07:33 -0500
>From: Berin Loritsch <bl...@apache.org>
>Reply-To: "Avalon Development" <av...@jakarta.apache.org>
>To: "avalon-dev@jakarta.apache.org" <av...@jakarta.apache.org>
>
>One thing we have identified at the Cocoon porject is the
>need to hide the implementation facts of whether a Component
>is ThreadSafe, Poolable, Factory, etc.
>
>To date, in order to do that we have had to come up with an
>inelegant Hack.
>
>The truly elegant and IMO correct way of doing things is to
>add a put() or return(Component) method so that every used
>Component has a definite beginning and ending.  It is a standard
>contract for all Composers to lookup and return components,
>that way the implementation details can be absolutely hidden
>from the end client of the Component.
>
>interface ComponentManager {
>    Component lookup (String role);
>    void return (Component usedComponent);
>}
>
>interface ComponentSelector implements Component {
>    Component select (Object hint);
>    void return (Component usedComponent);
>}
>
>This request comes from _hard_ _use_ of the ComponentManager
>system, and I think reflects a natural evolution that we
>should use.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: avalon-dev-help@jakarta.apache.org
>
>
>------------------------------------------------------------
>To subscribe:    java-apache-framework-on@list.working-dogs.com
>To unsubscribe:  java-apache-framework-off@list.working-dogs.com
>Problems?:       jon@working-dogs.com
>
>
Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*