From Crazy Bob Lee, founder and lead of Google Guice project…
The Spring Framework, created by Rod Johnson, blazed the Java dependency injection trail. If not the first dependency injection framework, you can certainly credit Spring with pioneering much of what we know about dependency injection and bringing it into the mainstream. Guice might not exist (at least not this early) if not for Spring’s example.Guice and Spring don’t compete directly. While Spring is a comprehensive stack, Guice focuses on dependency injection. Even so, the first question most people ask is, “how does Guice compare to Spring?” Rather than repeat the same spiel N times, we figured it best to answer the inevitable question once.
Without further ado, how does Guice compare to Spring…
What’s interesting is that Guice could be poised to become more than a container given these modules, add-ons, and the existence of Google Web Toolkit. By combining these with Guice, you may have the makings of a broader framework that could one day rival Spring.
Things that build on Guice include the following, for example:
- Gabriel – A permission-based security framework from Stephan Schmidt.
- Guice WebExtensions – New scopes for your web apps,
FlashScoped andConversationScoped - Warp – A component-based, event-driven web framework (a lightweight analog of Tapestry).
Integrations of Guice with other 3rd-party packages
- DWR-Guice Integration – Tim Peierls integrated Guice with DWR (Direct Web Remoting).
- Guice WebExtensions Persist and Dynamic Finders – make Guice and Hibernate/JPA like each other
- Wicket – A simple Java web framework with Guice support
Other
- Titan is like “Guice for .NET”
However, for now, Spring has such a head start in terms of acceptance and adoption, the one major remaining hurdle for Spring is eliminating the bloat or excess of XML, which I think has been a goal of the forthcoming Spring 2.1.