A simple dependency injection component
January 18, 2008 Leave a comment
Guice is alternative to Spring framework except life cycle management.
I like Guice framework over Spring for the following reason.
- Developer friendly. For example by seeing annotation any developer can understand the container will inject the object. Whereas in Spring, no body can guess why a setter method exists.
- Guice is much better than Spring framework because of the simplicity and less feature.
- Provides easy way to implement method interceptor.
- Another big advantage is no XML. It is not easy to debug XML document. (Remember EJB 2.0 failure) Developers are more comfortable to write code in Java rather than in XML.
The following links gives performance result of Guice.
http://www.javalobby.org/articles/guice-vs-spring/
http://gorif.wordpress.com/2007/07/05/google-guice-1000-faster-than-spring/