RE: [picocontainer-dev] Better CAF handling
Jörg Schaible <[email protected]>
| Newsgroups | gmane.comp.java.picocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
Paul Hammant wrote on Wednesday, May 23, 2007 10:10 PM:
> ( so I agree in the end with others on keeping 'ComponentAdapter'
> naming as is - it is for more advanced people )
>
> That said, I've dropped to Adapter only for the following discussion
> that Erik started some days ago. Which do y'all like best :-
>
>
> MutablePicoContainer mpc = new PicoBuilder().withWithCaching
> ().withThreadSafety().withHiddenImplementations().withSetterInjection
> ().build();
>
> MutablePicoContainer mpc = new PicoBuilder().withAdapters
> (caching().of().madeThreadSafe().of().hiddenImplementations().of
> ().setterInjection()).build();
>
> MutablePicoContainer mpc = new PicoBuilder().withAdapters
> (CACHING, THREADSAFE, IMPL_HIDING, CDI).build();
>
> or some other builder style design .. ?
How about:
MutablePicoContainer mpc = new PicoBuilder() {{
useSetterInjection(); // this is the factory !!
addThreadSafety();
addHiddenImplementations();
addCaching();
}}.build();
jMock2 syntax.
- Jörg
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email