CSC/ECE 517 Fall 2010/ch5 5e dr
Dependency Injection
Overview
Every enterprise application involves handful number of objects that work together to achieve some purpose. These objects are coupled with each other and work in collaboration, making the classes highly dependent. However, creating such code involving highly coupled classes defeats an important tenet of Object oriented design- ‘loose coupling’. Loose coupling means that objects should have the minimum number of dependencies, which makes the code easy to understand, modify and debug. It also allows for greater code reusability and improves the maintainability. http://www.codeproject.com/KB/architecture/DependencyInjection.aspx This drive to decouple the code from its highly dependent objects leads to the concept of Dependency Injection.