Introduction to AOP

xiaoxiao2021-03-06  113

AOP means programming, and he is a useful supplement to object-oriented programming. For example, our system has completed all core functions, but we need to increase security features, we can cut into existing code via AOP to provide effective security.

Java's AOP is developed to three forms so far:

1. Adopt a special special compiler, can be developed in a specific face-oriented programming language. This special language has Java as simple and beautiful, and it is very readable. It is now commonly used as an open source project aspectj.

2. Use a special type of loading, using Java language and XML combination. This method is more readable, but a special loader must be specified at runtime. It is now common to the JBoss AOP loader.

3. Adopt dynamic proxy, use Java language, but must introduce a dynamic agent-related class. The code readability written in this manner is relatively poor and is more cumbersome. It is now common to use the dynamic proxy function and open source Spring and Nanning dynamic proxy features provided by Java itself.

转载请注明原文地址:https://www.9cbs.com/read-126472.html

New Post(0)