What are the advantages of spring?
1. Reduced coupling between components and realized decoupling between layers of software
2. You can use many services that are easy to provide, such as transaction management and message service.
3. Container supports Singleton Mode
4. The Container provides the AOP technology, which can easily implement functions such as permission interception and runtime monitoring.
5. The Container provides many helper classes to accelerate application development.
6. spring provides integration support for mainstream application frameworks, such as hibernate, JPA, and Struts.
7. spring is a low-intrusion design with extremely low code pollution
8. Independent from various application servers
9. The di mechanism of spring reduces the complexity of Business Object replacement.
10. Spring is highly open and does not force applications to rely entirely on Spring. developers can freely choose some or all of spring's
What is DI mechanism?
Dependecy Injection and Inversion of Control are the same concepts. Specifically, when a role
When another role is needed, in the traditional programming process, the caller usually creates the instance of the caller. But in spring
Creating a caller is no longer done by the caller. Therefore, it is called control inversion. Spring completes the creation of the called USER and then injects the caller
Therefore, it is also called dependency injection.
Spring Manages objects in a dynamic and flexible manner, and sets injection and constructor injection in two ways.
Advantages of Setting Injection: intuitive and natural
Advantage of constructor injection: you can determine the order of dependencies in the constructor.
What is AOP?
Improve spring dependency injection (DI) for Aspect-oriented programming (AOP). Aspect-Oriented Programming mainly involves two aspects in spring.
1. Declarative Transaction Management for Aspect-Oriented Programming
2. spring supports custom aspect
Aspect-oriented programming (aop) is a supplement to Object-Oriented Programming (oop,
Object-Oriented Programming splits the program into objects at various layers, and object-oriented programming splits the program running process into various sections.
AOP considers the program structure from the perspective of program running and extracts the aspect of the business processing process. oop is a static abstraction, and aop is a dynamic abstraction,
Abstract The steps in the application execution process to obtain the logical division between steps.
The aop framework has two features:
1. Good isolation between steps
2. Source Code independence