RE: [picocontainer-dev] caf chaining in builder (done)

"Putrycz, Erik" <[email protected]>
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
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.

Erik Putrycz, Ph.D - Research Associate / [email protected] /
(613) 990 0681
Institute for Information Technology - Software Engineering Group
National Research Council, Canada - Building M-50, 1200 Montreal Road
Ottawa, Ontario, CANADA K1A 0R6

-----Original Message-----
From: Paul Hammant [mailto:[email protected]] 
Sent: May 29, 2007 11:10
To: dev-qxt/[email protected]
Subject: [picocontainer-dev] caf chaining in builder (done)

MutablePicoContainer mpc = new PicoBuilder
().withComponentAdapterFactories(CACHING(), IMPL_HIDING(), SDI
()).build()

They are in caps cos they are public static methods (thankfully
stateless).

Thoughts on the following ?

    withComponentAdapterFactories() versus withFactories()
   CACHING() versus caching() cache() singletons() singleInstances()
cached()
   IMPL_HIDING() versus HIDDEN() hidden() hide() hideThem()

- Paul

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email
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.