For quite some time it was obligatory to use Spring in a Java project; it became a defacto standard. Once you’re familiar with dependency injection you don’t want to code without it. One alternative to Spring was and still is PicoContainer. But then Guice came along: Googles lightweight dependency injection framework. I investigated it at the time it was released and now I wrote a simple comparison between Guice, PicoContainer and Spring because I’d like to integrate one framework into a project I’m working on.
If you’d like to read and watch something about Guice or Google check out the following links:
- the authors of Guice, Bob Lee and Kevin Bourrillion, present Guice
- Bob Lee presents Guice at the Google Developer Day in Beijing
- Kevin Bourrillion explains to his wife what extraordinarily typesafe means
- watch this short video or check out Googles channel on YouTube to get an impression how they’re working and what they’re working on – quite interesting.
During this comparison I’ll try to focus on DI only. To conclude that, say, Guice or PicoContainer is better than Spring, would be too general to be useful, since Spring is a lot more than just a DI framework.