Aspect-oriented programming (AOP) applies recurring supporting logic to selected method calls. Define that logic once instead of repeating it in business methods, keeping their main responsibilities easier to read and maintain. section 6.0
Design an aspect around three choices:
- Aspect: the logic Spring executes. section 6.1
- Advice: when that logic runs, such as before or after a method call. section 6.1
- Pointcut: which methods Spring intercepts. section 6.1
Figure 6.1 Sometimes it’s not relevant to have parts of the code in the same place as the business logic because it makes the app more difficult to understand. A solution is to move part of the code aside from the business logic implementation using aspects. In this scene, Jane, the programmer, is discouraged by the logging lines written together with the business code. Count Dracula shows her the magic of aspects by decoupling the logs into an aspect.

The figure contrasts logging mixed into business code with logging separated into an aspect. section 6.1

