Skip to main content

Aspect-Oriented Programming (AOP)

Learn Aspect-Oriented Programming (AOP) (AOP, Spring Boot) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

The Problem: Code That Does Not Belong Where It Sits Open any real service class and you will find two kinds of code mixed together. There is the code that answers the question the class exists to answer - transfer money, register a student, price an order. And there is the code that is there because the system needs it - logging, timing, security checks, transaction boundaries, retries, auditing. The second kind is called a cross-cutting concern . It cuts across the class hierarchy: it is not the responsibility of any one class, yet every class needs it. Because inheritance runs vertically...

More lessons in AOP