views:

164

answers:

3

I am looking for a very lightweight dependency injection framework for java. With minimum possible dependencies and minimum features.

Just something along the following lines: receive a java.util.List of Classes, instantiate them and just auto-wire all the objects one into the other.

+7  A: 

Maybe you should have a look at Google Guice: http://code.google.com/p/google-guice/

Mani
I second that. Guice is lightweight and very little intrusive.
Kimble
+5  A: 

I would recommend Spring, since this can provide a small footprint when using only the core packages.

If you think Spring is overkill, then perhaps PicoContainer, or guice?

toolkit
I'd recommend Spring with only using a BeanFactory implementation - much of Spring's "heavyweight" nature comes from using the ApplicationContext without people understanding what overhead (although cool features come with that overhead) the ApplicationContext adds on top of the BeanFactory.
MetroidFan2002
PicoContainer answers exactly to the requirements
flybywire
A: 

Definitely look into Guice. Been using it for a year, and absolutely love it.

Dennis