General
Using Commons Inject
Commons Inject is an implementation of JSR 330 (Dependency Injection for Java). Or, in other words: It is a dependency injection framework, like Google Guice, the core part of the Spring Framework, Dagger, or several others.
Yes, it passes the JSR 330 TCK, with and without static injection.
This means, if you have got an application, which is based on an alternative implementation of JSR 330, then it should be really easy, to port that application over to Commons Inject. In general, the only obvious thing to do would be to rewrite the configuration part. However, as Commons Injects configuration closely follows the configuration concepts from Guice, that should be really easy.
The author of Commons Inject believes that the framework has the following advantages over its competitors:
There is no need for a special installation. Just add the jar file to your project, like you would do with any other jar file. In the case of Maven, you would simply declare a dependency like this:
<dependencies> <!-- Other dependencies ... --> <dependency> <groupId>org.apache.commons.inject</groupId> <artifactId>org.apache.commons.inject</artifactId> <version>YOURVERSION</version> <dependency/> <dependencies/>