Re: [picocontainer-dev] caf chaining in builder (done)
Paul Hammant <[email protected]>
| Newsgroups | gmane.comp.java.picocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
I might still change to camelCase() :-) , but I don't think I'm going
to do an enum -
One new interface (a Factory to a Factory) feels wrong, plus there is
no room for flair when it comes to have a variable argument list for
the ctor of the more sophisticated variations like the JMX one.
The static-wildcard import is still possible.
- Paul
On May 29, 2007, at 9:15 AM, Putrycz, Erik wrote:
> I would suggest making all the static methods into enum.
> Something like
> interface CAFBuilder {
> public ComponentAdapterFactory createComponentAdapterFactory();
> }
> enum Builders implements CAFBuilder {
>
> SDI() {
> public ComponentAdapterFactory createComponentAdapterFactory() {
> return new SetterInjectionComponentAdapterFactory();
> }
> }
> ...
> }
>
> This way if you do an
> import static ...Builders.*;
>
> you can write
>
> MutablePicoContainer mpc = new PicoBuilder
> ().withComponentAdapterFactories(Caching, Impl_Hiding, SDI
> ()).build()
>
> I personnaly don't like so much the all uppercase for the builder.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email