1. AOP Concept: Aspect-oriented programming, refers to the extension function does not modify the source code, the function code is separated from the business logic code.
Main functions: Logging, performance statistics, security control, transaction processing, exception handling and so on.
The main intent: to divide the code of logging, performance statistics, security control, transaction processing, exception handling, and so forth from the business logic code, through the separation of these behaviors, we want to be able to separate them into non-guiding methods of business logic, and then change these behaviors without affecting the code of the business logic.
2. AOP Features: The repetitive code of traditional longitudinal inheritance system is replaced by the horizontal extraction mechanism.
The adorner is a well-known design pattern, which is often used in scenes where there is a demand for facets, with the classic insert log, performance test, transaction processing, and so on. Decorators are a great design for solving such problems, and with adorners, we can pull out a lot of the same code that is not relevant to the function itself and continue to reuse it. In summary, the function of an adorner is to add additional functionality to an already existing object.
Programming AOP and adorners for facets??