AspectJ

index

如何使用AspectJ Compiler開發AspectJ程式

AspectJ: A general-purpose, aspect-oriented extension to the Java programming language.

Crosscutting elements

All functions together

Design:
  1. Identify the join points at which you want to augment or modify the behavior.
  2. Design what that new behavior will be.
Implement:
  1. Write an aspect that serves as a module to contain the overall implementation.
  2. Write pointcuts to capture the desired join points.
  3. Create advice for each pointcut and encode within its body the action that needs to happen upon reaching the join points.

Pointcuts

Pointcuts capture, or identify, join points in the program flow.

pointcut可宣告於aspect、class、interface

Wildcards and pointcut operators