Aspect Oriented Programming seems to have quite a bit of promise, and Spring appears to support it. But there is very little guidance on how to do it, especially if you compare it to other topics like Spring Data or Spring Web MVC, (which I understand are much more popular topics).
Do you have any recommendations for reading on when you might use AOP (other than logging, please), and more to the point, how you would implement it in Spring 5?
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.
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.
"privilege" comes from the Latin words for "private" and "law" (legal) and dates to feudal times. To "claim privilege" meant that you were above the laws that applied to the common people.