avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Proposed addition to ComponentManager/Selector
Date Wed, 21 Feb 2001 14:07:33 GMT
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.

View raw message