[picocontainer-dev] [pico2] CachingBehavior + multiple instances..

peter royal <[email protected]>
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
in pico1-world, when using the CachingCAF, it means that you only  
want a single instance of the component.

with lazy instantiation, this means that if the component has no  
lifecycle, and if multiple threads ask for the component, you may get  
discrete instances (last one wins wrt the cache).

currently, in pico2, there are two behaviors, a CachingBehavior and a  
SynchronizedBehavior.. SyncBehavior being simple, just wrapping  
another behavior and synchronizing getComponent. idea being you could  
use these to to achieve the intent of the pico1 behavior..

thought is that if you are using the CachingBehavior, you only want a  
single instance at that point in the chain, and it should ensure that  
it only ever creates a single instance.. thus the SyncBehavior can go  
away.

thoughts? (lazy consensus)!

-pete

-- 
(peter.royal|osi)@pobox.com - http://fotap.org/~osi
smime.p7s (application/pkcs7-signature, 2.4 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.