Basically, we should be able to adjust the behavior at startup by providing the required classes that will be produced by various factories within our application (to avoid tightly binding the "new" operator).
I know this is provided by several large frameworks, but I was looking for something easily used by a standalone Java application, without a giant one.
Any suggestions?
Edit: In my experience, frameworks tend to grow as part of ripening (and complex too). I need this so that it can be retrofitted into an outdated application as part of the main refactoring (technical duty), so simplicity is important for the libraries used. I am not averse to doing a bit of coding in our application, but it should be very clearly visible what is happening. AOP tends to move material to the side, and this can make the application difficult.
Edit: we have reached the point where we really need to make a decision. The application is likely to live for many decades, so we need to make a reversible decision with a framework that will be supported with hope for a long time. I really like the static type check available with Guice, but not that the annotations are explicitly bound to Guice, and not as external as in Spring. I also like that this code seems to be more concise when using Guice, not Spring. We need something reliable and useful. At the moment, we do not need more than just DI. Is there a precedent that says the final version for one of them?
Edit 2011-07-27: The final solution was to use the JSR-330 API in the code and select for each project if you use Spring, Guice or Weld. For stand-alone applications, Guice has proven itself in implementing the JSR-330.
java dependency-injection
Thorbjørn Ravn Andersen
source share