Peter Rooke wrote:My understanding is the idea behind AOP is to address two major issues with code; code scattering and code tangling.
Logging, transactions, security, debugging, diagnostics would be candidates.
Cross-cutting.
The normal organization of a system's functions is a hierarchical tree (Directed Acyclic Graph), working from the top down. With AOP, you go sideways instead.
A tree can have only one root. You can, however, have many aspects, as you've noted.
To simplify the application of aspects, one defines templates and uses a code processor to apply them to existing code. This can be done either at the source code level (which means basically writing an entire compiler) or by weaving into the generated bytecodes - which avoids having to do a lot of lexical scanning, parsing, and digestion.
In a sense,
Java annotations also embody AOP, but you have to manually attach them to the code in question.
Spring itself has several function sets that lend themselves to the aspect-oriented approach. So what Keith really wanted to know is how Spring 5 changes them.