Aspect-oriented programming
Aspect-oriented programming is a technique that modularizes cross-cutting behavior and applies it to existing code at specified join points.
Grokking Software Architecture
A programming technique that modularizes cross-cutting concerns and automatically applies them at designated join points in program execution.
- How it is used
- Automates uniform cross-cutting logic, such as logging, around selected methods while keeping business logic separate.
- How deep it goes
- Defines runtime or compile-time weaving, demonstrates method logging, and notes overhead and limited access to business context.
- Examples
- Shows a framework weaving a log call into OrderService.saveOrder.
- What you can do after
- Evaluate AOP as an automated option for uniform cross-cutting behavior, weighing cleaner business logic against overhead and limited data context.
Read how Grokking Software Architecture explains aspect-oriented programming →
Spring Start Here, Second Edition
Aspect-oriented programming is a programming technique that modularizes behavior applied across multiple program components, such as logging or transaction management.
- How it is used
- Decouples recurring supporting logic from business methods and applies it to selected calls.
- How deep it goes
- Defines aspects, advice, and pointcuts, while stopping short of implementation details.
- Examples
- Uses logging, permission checks, execution-time measurement, and transaction management as examples.
- What you can do after
- Evaluate whether recurring non-business logic should be separated to reduce duplication and improve readability.
Read how Spring Start Here, Second Edition explains aspect-oriented programming →
Also covered in
- Building Web APIs with ASP.NET Core
- Clean Applications with Hexagonal ArchitectureIn early access (MEAP)
What to know first
- dependency injectionDependency injection is a software design technique in which a component receives its dependencies from outside rather than creating or locating them internally.
Related concepts
- advicehas part · Advice is aspect-oriented logic executed at a specified point in a program’s execution, such as before, after, or around an intercepted operation.
- cross-cutting concernuses · A cross-cutting concern is a software responsibility or behavior that affects multiple components, features, or architectural layers rather than belonging to one alone.
- pointcuthas part · A pointcut is an aspect-oriented specification identifying program execution points at which advice is applied.
- inversion of controlimplemented by · Inversion of control is a design principle in which control over execution flow, object creation, or dependency provision is transferred from application code to an external mechanism or component.
- separation of concernsimplements · Separation of concerns is a design principle that organizes a system into parts with distinct responsibilities and limited overlap.
- interceptorimplemented by · An interceptor is a software component that intercepts operations, requests, or messages to inspect or modify them or apply behavior around their processing.
Questions about aspect-oriented programming
What is aspect-oriented programming?
Aspect-oriented programming is a technique that modularizes cross-cutting behavior and applies it to existing code at specified join points.
Which Manning books explain aspect-oriented programming?
Grokking Software Architecture and Spring Start Here, Second Edition.
What should I know before learning aspect-oriented programming?
Manning books that teach aspect-oriented programming usually introduce dependency injection first.
What are the parts of aspect-oriented programming?
Aspect-oriented programming includes advice and pointcut.
What is aspect-oriented programming also called?
Aspect-oriented programming is also called AOP.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

