DELAPARRA
Index
Color
NL
Category: Programming paradigms

Aspect

Explained by Updated

What is Aspect?

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.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about Aspect

How is Aspect used in practice?

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.

At a glance

CategoryProgramming paradigms
Explained by
Updated

More Programming paradigms terms

All terms starting with A

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.