Spring- acquaintance Aop

Aop

Aspect Oriented Programming, when the program is running, without changing the source code of the program, the function of dynamic enhancement methods.

concept Explanation
Cut-off point To add code places
Notification / enhancement Dynamically add code to the tangent point
section Cut-off point + notification
Junction Defined cut-off point

Aop implementation

  1. cglib
  2. jdk

Aop notification type

  1. @Before: pre-notification, to operate before the target method is executed.
  2. @After: Rear notification, an operation performed after the target method.
  3. @Around: Surround notification, an operation performed after and before the target method.
  4. @AfterThrowing: exception is thrown notice, the program operates when an exception occurs.
  5. @AfterReturning: Returns the notice, the target method returns a value of time will trigger.
Published 25 original articles · won praise 0 · Views 289

Guess you like

Origin blog.csdn.net/qq_42219004/article/details/105177347