What is Dependency Injection ?

“Dependency Injection”, the word itself clarifies that we are trying to Inject the dependency between the Parent Classes and the calling Class. But how spring provides it as a Feature and how it is different from previous implementation, is what we need to understand.

Java Programming Concept is all about the object oriented programming,
class instantiation, encapsulation and polymorphism. Spring also executes on
the same implementation but it provides a simple approach where it allows to
make a class independent from its dependencies. To achieve this and make
classes loosely decoupled, Spring separates the class creation and class usage
(invoked by another dependent class).

Dependency Injection is implemented by using the technique termed as ‘Inversion of Control’. First, we need to understand how IoC Container uses the Spring Framework.

How IoC Container uses the Spring Framework ?

Bean Factory: The advanced configuration capability comes from the usage of theBeanFactory. It acts as a Factory class and provides Bean Definition for the multiple application beans and create instances of the bean whenever is requested by the client call.