Java Ques3
Java Ques3
Predefined Templates
Loose Coupling
Easy to test
Lightweight
Fast Development
Powerful Abstraction
Declarative support
Test
Spring Core Container
AOP, Aspects and Instrumentation
Data Access/Integration
Web
In this, the Dependency Injection will be injected with the help of setter and/or
getter methods. Now to set the Dependency
Injection as Setter Injection in the bean, it is done through the bean-
configuration file For this, the property to be set
with the Setter Injection is declared under the <property> tag in the bean-config
file.
In Constructor Injection, the Dependency Injection will be injected with the help
of constructors.
Now to set the Dependency Injection as Constructor Dependency Injection in bean,
it is done through the bean-configuration file.
For this, the property to be set with the CDI is declared under the <constructor-
arg> tag in the bean-config file.
==>> What is the difference between constructor injection and setter injection?