Spring Framework (eight): the concepts of spring aop

I. Overview of spring aop

In the software industry, AOP is the abbreviation for Aspect Oriented Programming, meaning: Aspect Oriented Programming , by precompiled dynamic agent program features a technology to achieve a unified manner and maintained during operation. AOP is OOP continuation, is a hot spot in software development, but also Spring an important element of the framework is the functional programming a Yansheng Fan type. AOP can use to isolate each part of the business logic such that the business logic portions between coupling reduction, improve the reusability of the program, while improving efficiency of development.

Two, spring aop features

  • Extended new features without changing the original function code on;
  • AOP can use to isolate each part of the business logic such that the business logic to reduce the degree of coupling between the parts, improve the reusability of the program, while improving development efficiency, easy maintenance code.

Three, spring aop related terms

1, Joinpoint (connection point)

  • Those points are intercepted, in the spring, these points refers to a method, because only the spring type connection point supporting method.

2, Pointcut (entry point)

  • We need to define the connection point of interception.

3, Advice (notification / enhanced)

Definition: After the interception refers to Joinpoint have to do it is to tell.

Notification type

  • Before advice: executed before the entry point method is executed.
  • Post Notification: The method is performed after the entry point normally. It can only ever execute one exception notification.
  • Abnormal notice: entry point method is executed after the implementation of an exception. It and post a notice can only ever be executed.
  • The final notice: No matter whether the normal entry point method it will perform at its rear.
  • Surround notification: manual coding is provided pre-notification, the notification rear, abnormality notification and the final notification.

Note: Use the around advice can explicitly specify when to perform a variety of notification.

4、Introduction(引介)

  • Notification is a special class code without modifying the premise, or can add some methods Field class dynamically at runtime.

5, Target (target audience)

  • Acting audience.

6, Weaving (weaving)

  • It refers to the enhancement applied to the target object to the process of creating a new proxy object. Agent dynamic spring weaving, while the weaving AspectJ using compile and class loading of weaving.

7, Proxy (proxy object)

  • After a category is woven into the reinforced AOP, to produce a result proxy class.

8, Aspect (section)

  • It is a combination of point and notification (introduce) a.
Published 134 original articles · won praise 10 · views 7353

Guess you like

Origin blog.csdn.net/yu1755128147/article/details/103811510