--- Bob Lee <[EMAIL PROTECTED]> wrote: Hi Bob, I'd like to say that I'm codeveloper of pico/nanocontainer.
> Type checking, performance, documentation, less > code, generic types support, > cleaner configuration (Guice uses a nice EDSL), no > setter method > requirement, up front error checking with user > friendly messages, simpler > API... let separate DI container from DI container buildup. pico (di-only part) offers nothing than DI, you can build up hierarchical tree of containers. you request component from a leaf - it is delivered. distinctive feature are component adapters, which determine how components are wired together. adapters can be stacked to provide specific behaviour ( caching / hot swapable / remoting /aspects / constructor injection / setter injection / etc. ) Everything can be done in java code. nanocontainer is a next step and provides various means to externalize this configuration. (xml, groovy, whatever else) > IMHO, Annotations are cool and sexy, but they are > not > > usefull in this context as they are bound to > compile > > time. > So are interfaces. :) well, but I do not use interfaces to wire my components together ( explicitely ) > What's important is that you don't depend on the > implementation. Depending > on the interface and annotation is OK. Strings are a > pain. We do not depend on string keys to dientify components - key in container is just object, and is needed only in case of ambiguity ( but it could be string as well ) > This is where custom providers come in. You inject > the provider and then > create your object. If you provide a more detailed > example, I'll provide a > code example. What kind of exmaple do you like? http://jtec.svn.sourceforge.net/viewvc/jtec/jtec-user/trunk/src/java/de/jtec/user/hibernate/HibernateUserManager.java?revision=106&view=markup This is my hibernate user manager. Using constructor injection it only needs hibernate session ( and does not care where it comes from ) As hibernate guys decided to use weird factories everywhere, there was a need for custom wrapper for it which is proxying session (part of persistence subproject of pico/nanocontainer) Basically I just register this session component - and my HibernateUserManager receives it in constructor. Why do I need an annotation to achieve this? > Guice supports properties files and can convert the > types at startup. I also > see no reason why you couldn't implement Module > using Groovy. Well, there is still a question why it is better than pico ;) Pico is also integated with WW2 and struts ( if not - I can contribute it if you like ) regards, ----[ Konstantin Pribluda http://www.pribluda.de ]---------------- Still using XDoclet 1.x? XDoclet 2 is released and of production quality. check it out: http://xdoclet.codehaus.org ____________________________________________________________________________________ Cheap talk? Check out Yahoo! Messenger's low PC-to-Phone call rates. http://voice.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]