| Re: [aspectj-users] Philosophical Questions |
2) Can pointcuts be modeled separately from advice?
I think about pointcuts with like a special kind of operations that can be invoked by the system itself when certain conditions are met. These conditions (the jointpoints) and their context (caller object, parameters ...) are part of the signature of the pointcut.
I see the advice as executable code that is associated with a pointcut. In regular OOP you have abstract operations, with signature but without code, and concrete methods (implementations of that operations).
So I think that in AOP abstract pointcuts (without advice) are the equivalent of abstract operations and advice are the concrete methods.
Of course advice without a pointcut have no sense in the same way that a piece of code have no sense without an operation with his signature. But it is usefull to have this separation because you could have different advices for the same pointcut (like polymorphic methods in OOP).
To sum up, separation pointcut/advice? yes. Full independence? no, the advice must always run in the context of a pointcut.