Skip to main content

Aspect

Simple Story

Some rules do not belong to any one pupil. "Check the checklist before picking up a paper" applies wherever a paper is picked up.

Writing that into every desk would be hopeless: you would miss some, and a pupil's work is not yours to edit anyway. An aspect is that rule written down once, in one place, and then applied everywhere it is needed.

What it is

An aspect is the module that holds a cross-cutting concern. It brings together the places the concern applies to (its pointcuts) and the behaviour to run there (its advice).

In Ares the concern is the security check itself. The advice classes under api/aop hold the logic that decides whether a file, command, thread or network operation is permitted, written once and applied at every point where such an operation can occur.

Further reading