Dependency Injection was earlier referred to as "inversion of control". Here what we are doing is that the acquisition of dependencies that is being inverted. Traditionally, each object if responsible for obtaining its own references to objects it collaborates with( its dependencies) which leads to highly coupled and hard-to-test code. In Dependency Injection, objects are given their dependencies at creation time by some external entity that coordinates each object in the system.i.e dependency is injected into objects.
View All Comments
| View Tutorial