next up previous
Next: Late Binding of Advice Up: Ad-hoc Polymorphism in AspectJ Previous: Overriding an advice

Run-time pointcut designators and run-time aspect instances

To complete the picture we must also consider run-time pointcut designators such as this, target, cflow, cflowbelow, args, and if, as well as run-time aspect instance specifications such as perthis, pertarget, percflow, and percflowbelow.

Run-time pointcuts would seem to introduce the dynamism that is otherwise missing in the invocation of advice code, but they are in fact only capable of enabling or disabling the given advice. Since dynamic dispatch is concerned with a dynamic selection of which piece of code to execute, not just whether to invoke a given piece of code or not, even these kinds of pointcuts do not introduce full polymorphism into AspectJ, apart from the situations where the polymorphism is inherited from the base language.

Aspect instances also introduce a level of dynamism. However, selecting which aspect instance to use is not the same as dynamically selecting which piece of code to execute: the choice is whether or not to execute a piece of code that is fully determined by the aspect instance, not which piece of code to execute, based on the type of the object to which the advice is applied. Non-polymorphic aspectual code is a step back from OOP. In this paper, we revisit the AOP model and discuss the potential for supporting aspectual polymorphism.


next up previous
Next: Late Binding of Advice Up: Ad-hoc Polymorphism in AspectJ Previous: Overriding an advice
David H. Lorenz 2003-01-15