Re: [picocontainer-dev] annotations and comments on Pico2

peter royal <[email protected]>
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
On May 19, 2007, at 4:51 PM, Paul Hammant wrote:
> I chatted with Peter Royal* last night about adding (optional) the  
> follow syntax for any injection type (incl constructor / setter as  
> we always used to have it)....
>
>    pico.addComponent(Foo.class, FooImpl.class).with(HIDING);
>    pico.addComponent(Bar.class, BarImpl.class).as(SINGLETON);

pico.addComponent(Foo.class, FooImpl.class).with(hiddenImplementation 
());
pico.addComponent(Bar.class, BarImpl.class).as(singleton());

(hiddenImplementation and singleton are static methods on some helper  
class that can be statically imported)

-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.