Thursday, April 5, 2007

google-guice

Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 5, brought to you by Google.

Guice wholly embraces annotations and generics, thereby enabling you to wire together and test objects with less effort than ever before. Annotations finally free you from error-prone, refactoring-adverse string identifiers.

In a nutshell:
  • Guice empowers dependency injection.
  • Guice cures tight coupling.
  • Guice enables simpler and faster testing at all levels.
  • Guice reduces boilerplate code.
  • Guice is type safe.
  • Guice externalizes configuration when appropriate.
  • Guice lets you compose your application of components which are truly independent.
  • Guice reports error messages as if they will be read by human beings.
  • Guice is the anti-static.
  • Guice is small and very fast.

Guice injects constructors, fields and methods (any methods with any number of arguments, not just setters). Guice includes advanced features such as custom scopes, circular dependencies, static member injection, Spring integration, and AOP Alliance method interception, most of which you can ignore until you need it.

An earlier version of Guice already powers Struts 2's plugin architecture.

Guice HomePage

0 Comments: