An execution chain is the ordered path through which multiple aspects delegate a method call to one another and, eventually, to the intercepted method. Each aspect can also affect whether the call proceeds. section 6.3
Order matters when aspects have different effects:
- If SecurityAspect runs first and declines to delegate, LoggingAspect never runs; it cannot log that call. section 6.3
- Spring does not guarantee the default order. Use @Order on an aspect to set it; a smaller number runs earlier, while equal values leave the order undefined. section 6.3
A comment service call
For publishComment(), LoggingAspect can run before SecurityAspect, which delegates to the service method. Reversing their order can prevent logging when security stops the call. section 6.3
Figure 6.14 The aspect execution order matters. Depending on your app’s requirements, you need to choose a specific order for the aspects to execute. In this scenario, the LoggingAspect cannot log all the method executions if the SecurityAspect executes first.

Compare the two possible orders and see why logging may miss calls when security runs first. section 6.3
