1. What is AOP and how it is implemented
1.1. What is AOP
Aop:aspect oriented programming abbreviation, meaning: aspect-oriented programming, through the pre-compilation method and run-time dynamic agent to achieve a unified maintenance of program functions of a technology.
The main functions are: Logging, performance statistics, security control, transaction processing, exception handling and so on.
1.2. How AOP is implemented
1.2.1. Pre-compilation
--aspectj
1.2.2. Run-time dynamic agent (JDK Dynamic agent, cglib dynamic agent)
--SPRINGAOP, JBOSSAOP
1.3. The use of AOP in the spring framework
1.3.1. Statement of declarative Enterprise services, especially alternative services for EJBS
1.3.2. Allows users to develop their own aspects to accomplish the complementary use of OOP and AOP
1.4. Spring's AOP implementation
1.4.1. Pure Java Implementation, no special compilation process required, no control of class loader hierarchy
1.4.2. Currently only method execution connection points are supported (notifies the spring bean method execution)
1.4.3. Not to provide the most complete AOP implementation, but instead focus on providing an AOP implementation and integration between the spring IOC containers to help solve common problems in enterprise applications
1.4.4. Spring AOP does not compete with ASPECTJ to provide a comprehensive, holistic approach to AOP
1.5. Different spring AOP implementations with and without interfaces
1.5.1. Spring AOP defaults to using the standard javase dynamic proxy as an AOP proxy, which allows any interface (or set of interfaces) to be proxied
1.5.2. Cglib Proxy can also be used in Spring AOP (if a business object does not implement an interface)
2. Configure the slice aspect
2.1. schema-based AOP
Spring all of the post-section notifier must be placed within a <aop:config> (can be configured to contain multiple <aop:config> elements, each <aop:config> can contain pointcut, Advisor and aspect elements)
<aop:config>-style configuration heavily uses spring's automatic proxy mechanism
2.2. Aspect
2.2.1. <aop:config>
2.2.2. <aop:aspect>
1 <Aop:config>2 <Aop:aspectID= "Myaspect"ref= "Abean">3 ...4 </Aop:aspect>5 </Aop:config>6 7 <BeanID= "Abean"class="...">8 ...9 </Bean>
3. Configure Pointcut Pointcut
4.
2. Basic concepts of AOP
3. AOP in Spring
4. schema-based AOP
5. Spring AOP API
6. AspectJ
Basic concepts of AOP