Aspect Oriented Programming with Spring
Iuliana Cosmina · Apress eBooks · 2016
AOP is an acronym for Aspect Oriented Programming, a term that refers to a type of programming that aims to increase modularity by allowing the separation of cross-cutting concerns. A cross-cutting concern is a functionality that is tangled with business code, which usually cannot be separated from the business logic. Auditing, security, and transaction management are good examples of cross-cutting concerns. They are mingled with the business code, heavily coupled with the functionality that might be affected if they fail. These are good candidates for separation using aspects, because there is no design pattern that would allow writing the code in such a way that they would be separated from the business logic. This means that additional behavior is added to existing behavior when the application is compiled. So transaction management, security logic, and auditing can be developed separately and mingled with the functionality at compile time. This is done by defining an advice containing code that will be executed in a location named join point specified by a point cut. This approach allows for code implementing behavior that is not related to business logic to be separated from functional code, the result being a more modular, less coupled, and less cluttered application.