Dependency Injection (DI) is a powerful design and implementation technique to create designs that result in loosely coupled classes in object-oriented environments. IOC containers such as Spring provide a framework to describe the DI constructs for classes that have been designed with dependency inversion. However the knowledge of classes and their dependency is now distributed between the code and context files where the wiring of the classes (beans) is specified. While IOC containers are able to automatically inject dependent objects at run time based on wiring descriptions, programmers often have the tedious job of ensuring that the wiring descriptions are type safe and will not result in runtime exceptions. We propose an object reflection driven approach to provide DI verification based on static analysis of the classes that have dependency inversion and their wiring descriptions.
[1]
Craig Walls,et al.
Spring in Action
,
2004
.
[2]
David Lorge Parnas,et al.
The Modular Structure of Complex Systems
,
1984,
IEEE Transactions on Software Engineering.
[3]
D. L. Parnas,et al.
On the criteria to be used in decomposing systems into modules
,
1972,
Software Pioneers.
[4]
Dhanji R. Prasanna,et al.
Dependency Injection
,
2009
.
[5]
Herbert A. Simon,et al.
Aggregation of Variables in Dynamic Systems
,
1961
.
[6]
Richard N. Taylor,et al.
Software architecture: foundations, theory, and practice
,
2009,
2010 ACM/IEEE 32nd International Conference on Software Engineering.