Spring Dependency Injection Class Notes
Spring Dependency Injection Class Notes
Injection
Dependency Injection
1. Dependency: An object usually requires objects of
other classes to perform its operations. We call these
objects dependencies.
2. Injection: The process of providing the required
dependencies to an object.
Dependency Injection
Constructor Injection
• Constructor injection uses the constructor to inject dependency
on any Spring-managed bean.
Setter Injection
• Setter injection uses the setter method to inject dependency
on any Spring-managed bean.
fi
.
fl
.