Principle of Dependancy Injection
Dependancy Injection can be achieved without a framework. While using a framework such as Spring, Guice or NanoContainer can make be simpler what can also make debugging, code analysis and refactoring more difficult. Additionally, these frameworks tend to have support for auto-wiring of components which complicates maintainence.
An alternative is to use a plain Java Configuration File which can be compiled inpendantly of the rest of the application. This is a plain Java class which constructs and wires your application together. This functionally is externalised from the main body of your application without using an external file format. To support dynamic loading of a the configuration file you can use a Java Config File loader
Add Comment