Dependancy Injection

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

Links

http://www.martinfowler.com/articles/injection.html

http://en.wikipedia.org/wiki/Dependency_inversion_principle

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.