Spring Features

1. Non-intrusive The
so-called non-intrusive means that the API of the Spring framework will not appear in the business logic, that is, the business logic is POJO (Plain Old Java Objects). Since there is no Spring API in the business logic, the business logic can be quickly ported from the Spring framework to other frameworks, that is, independent of the environment.

2. Container
Spring, as a container, can manage the life cycle of objects and the dependencies between objects. You can define objects and set dependencies with other objects through configuration files.

3. IoC
Inversion of Control, that is, creating an instance of the callee is not done by the caller, but by the Spring container and injected into the caller.
When IoC is applied, other objects that an object depends on are passed in passively, rather than the object creating or finding dependent objects by itself. That is, instead of the object looking for dependencies from the container, the container actively passes the dependencies to it when the object is initialized without waiting for the object to request it.

4, AOP
Aspect Orient Programming (AOP, Aspect Orient Programming), is a programming idea, is the supplement of object-oriented programming OOP. Many frameworks implement the idea of ​​AOP programming. Spring also provides rich support for aspect-oriented programming, allowing development by separating the application's business logic from system-level services such as logging and transaction management. Application objects do only what they are supposed to do - complete business logic - nothing more. They are not responsible for other system-level concerns, such as logging or transaction support.
We can understand services such as logging, security, and transaction management as a "facet". In the past, these services have always been written directly in the code of business logic, which has two disadvantages: first, the business logic is not pure; second, these services It is used repeatedly by many business logics, and can be stripped out for reuse. Then AOP is the solution to these problems. These services can be stripped out to form an "aspect" for reuse, and then the "aspect" can be dynamically "woven" into the business logic, so that the business logic can enjoy this "aspect" " service.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326154018&siteId=291194637