- Constructor Injection
- Setter Injection
Dependency Injection is a fundamental aspect of the Spring framework, through which the Spring container "injects" objects into other objects or "dependencies".
Simply put, this allows for loose coupling of components and moves the responsibility of managing components onto the container.
https://repo.spring.io/release/org/springframework/spring/
- Choose the latest stable release "*-dist.zip".
- Copy all the jar files under lib folder from the downloaded zip.
- Create a new folder name lib under your working directory.
- Paste those jar files under lib folder.
- Add classpath to your eclipse project.
- Right click on your "Project" >> "Properties" >> "Java Build Path" >> "Libraries" tab >> Click "Add JARs" >> "Select all the JAR files from you lib folder" >> "Apply and Close".
- Now there will be a "Referenced Libraries" folder which will have your all spring JAR files.
- Done
Right click on your project >> Run As >> Java Application