Gigix said that J2EE's world is like a magical forest, countless new concept and Open Source Framework, so that new students are very dizzy. Gigix also said that AOP is becoming the next Holy Cup for software development, huh, I think of the holy cup in the Empire Times, the monks have a way to collect, can improve the spiritual power ...
When you go back to the DAO framework for learning IBATI, it is mentioned that AOP is also supported in Spring Framework, which is also a dynamic proxy method using JDK1.3. But the configuration is more elegant.
I took the simple example, which is based on the org.springframework.aop.methodbeforeadvice interface to implement the interceptor. Now online AOP, the example is always log, fainting. Transaction parcels in iBatis can also be considered a typical usage.
When using Spring's AOP, in addition to Spring.jar, remember to introduce the following packages:
AopAlliance.jar2. ComMMons-logging.jar
3.jakarta-orom-2.0.8.jar This is more concealment because this compile period is not reported.
Then you have to understand the three concepts, you can write a AOP module.
Advice I want to inject the code that is injected within the other class, that is, you pay attention to the aspect;
PointCut defines a location that needs to be injected into the Advice, which is usually a PUBLIC method for a particular class.
Advisor is the PointCut and Advice assembler, you need to indicate two properties in the configuration file: Advice and Pattern, the former is the class you write, do something such as plus log, judgment if there is permission, Pattern You need to intercept the interface and its methods.