avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Royal <pro...@apache.org>
Subject Re: FW: ContainerManager and Sub-containers
Date Thu, 06 Jun 2002 13:43:44 GMT
On Wednesday 05 June 2002 08:51 pm, Peter Donald wrote:
> So pre-bake the components. Then when you need to lookup a Generator then
> do
>
> class MyClass
> {
>    public void service( final ServiceManager sm ) throws SE
>    {
>      myGeneratorManager = (GeneratorManager)sm.lookup(
> GeneratorManager.ROLE ); }
>
>    void doRequest( ....params ...)
>    {
>      g = myGeneratorManager.lookup( someOptimizedKey );
>      g.generate();
>      myGeneratorManager.release( g );
>    }
> }
>
> If you notice I used the same API as current SM with an optimized key. You
> could replace it with something more particular to generators though. The
> above demonstrates an effective way IMHO to create and manage generators
> that as performance sensitive as you need. It also follows suit with other
> established scalable frameworkss (ie J2EE, CORBA) and best of all it does
> not inflict the rest of us with complexity.

I see your side very clearly now.

I think the problem may arise from thinking along the lines of:

  Since the GeneratorManager is just like a ServiceManager, except it 
  only has Generators, why not just use a ServiceManager instance and 
  avoid writing a new class?

-pete

-- 
peter royal -> proyal@apache.org

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


Mime
View raw message