pom.xml
Application Context
resources -> New -> Spring Bean Configuration File
---------------------------------------------------------
Component Scanner
Xml Declaration
Component Scanner Demo
applicationContext.xml
---------------------------------------------------------------------
Stereotype Annotations
- @Component, @Service, @Repository
- Semantically the same
- @Component - any POJO
- @Service - business logic layer
- @Repository - data layer
Stereotype Annotations Demo
-----------------------------------------------------
Autowire
- Better with Annotations
- Tied to location
- Member Variables
- Constructor
- Setter
Autowired Member Variable
Member Injection Demo
Application.java
applicationContext.xml
---------------------------------------------------
Autowired Setter Injection
Autowired Constructor Injection
-------------------------------------------------------
- Dependency Injection for Java
- Beyond our scope
- Why Spring?
---------------------------------------------------------
Java Configuration
https://blog.csdn.net/u012596785/article/details/79856841