Aspect: A module that encapsulates a cross-cutting concern, e.g. a LoggingAspect or TransactionAspect. An aspect is a module that groups behaviour cutting across many parts of an application, such as logging, security checks or transaction handling. Instead of adding the same lines to dozens of methods, you describe it once in an aspect.
The aspect contains two things: where it applies, called pointcuts, and what it does there, called advice. A LoggingAspect might say: before every public method in the billing services, log the method name and arguments.
What should you keep in mind with Aspect?
This keeps business code focused on business rules. The cost is that behaviour becomes less visible, because reading a method no longer tells you everything that happens when it runs. In PHP and JavaScript, full aspect frameworks are rare. Middleware, decorators and event listeners solve most of the same problems in a more explicit way.
Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.