Aspect
- A “concern” is a specific requirement or consideration that must be addressed in order to satisfy the overall system goal.
- Crosscutting concerns are encapsulated in separate modules, called “aspects”, so that localization can be achieved.
- Any application is composed of multiple functional and non-functional concerns. Functional concerns are relevant to the actual use of the application, whereas non-functional concerns pertain to the overall quality attributes of the system, such as the performance, transactions and security. Even applications that are designed in a highly modular fashion suffer from tangling of functional and non-functional aspects.
- Usecases that AOP mechanisms are useful in: security, logging, monitoring, transactions, and caching.
Implementation
- There are two varieties of crosscutting, static (compile time) and dynamic (at runtime)
- A “join point” is an identifiable point of execution in an application, such as a call to a method or an assignment to a variable
- A “pointcut” identifies a join point in the program at which a crosscutting concern needs to be applied.
- An “advice” is a piece of code implementing the logic of a crosscutting concern. It is executed when a specified pointcut is reached.
Frameworks
- AspectJ
- JBoss AOP
- AspectWerkz
page revision: 2, last edited: 05 Aug 2011 01:12