avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen McConnell <mcconn...@apache.org>
Subject Re: [RT] semantic conflict - poolable
Date Fri, 17 Oct 2003 21:54:54 GMT


Leo Sutic wrote:

>  
>
>>From: Stephen McConnell [mailto:mcconnell@apache.org] 
>>
>>a solid defition of the four "standard" lifestyles.
>>    
>>
>
>I think we already have that. Pooled means one-per-lookup,
>from a common pool, singleton means singleton per container, 
>transient means one new instance per lookup.
>
>Why not just let the definitions stand as they are? I think
>they are clear enough. The words "pooled" and "singleton"
>are well defined. "Transient" is made up here, but if we
>say "one new instance for each lookup()" then I think
>most people will understand.
>

Some questions for you - here is a defintion of a container with two 
components. Lets assume that the component lifestyle is singleton.

<container name="demo">
   <component type="PersonProvider" name="accounts">
     <configuration>
        <name>Sally</name>
     </configuration>
   </component>
   <component type="PersonProvider" name="logistics">
     <configuration>
        <name>Carol</name>
     </configuration>
   </component>
</container>

I've just broken you defintion of a singeton.  My notion of a 
"singleton" lifestyle is that an instance of an identifiable component 
deployment scenario may be shared across all requests - and that 
multiple deployment scenarios may coexist for that type.  In the above 
example - we would see two component managers each differentiated in 
terms of the deployment scenario (different confuration or parameters, 
etc.).

Transient - a new instance per lookup - fine with that.
Pooled - nothing more than a managed transient.
Thread - same as singleton except that is scope with respect to sharing 
is a new instance per thread.

Stephen.

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org




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


Mime
View raw message