Dependency Injection(DI) in Spring
What do you mean by Dependency injection?
Answer : Inject Dependencies at runtime. Container inject dependencies of component by setting implementation object.
Dependency Injection can be of two types.
1. Constructor Based.
2. Setter Based.
To Implement this loose coupled code you need to have spring.jar, log4j.jar and common-logging.jar configured to your buildpath.
Please follow the project structure to setup your project as shown in the image below.
Comments
Post a Comment