While aspect-oriented programming supports the modular definition of crosscutting concerns, most approaches to aspect- oriented programming fail to improve, or even preserve, modular reasoning. The main problem is that aspects usually carry, through their pointcuts, explicit references to the base code. These dependencies make programs fragile. Changes in the base code can unwittingly break a pointcut definition, rendering the aspect ineffective or causing spurious matches. Conversely, a change in a pointcut definition may cause parts of the base code to be advised without notice. Therefore separate development of aspect-oriented programs is largely compromised, which in turns seriously hinders the adoption of aspect-oriented programming by practitioners. We propose to separate base code and aspects using Join Point Interfaces, which are contracts between aspects and base code. Base code can define pointcuts that expose selected join points through a Join Point Interface. Conversely, an aspect can offer to advise join points that pro- vide a given Join Point Interface. Crucially, however, aspect themselves cannot contain pointcuts, and hence cannot refer to base code elements. In addition, because a given join point can provide several Join Point Interfaces, and Join Point Interfaces can be organized in a subtype hierarchy, our approach supports join point polymorphism. We describe a novel advice dispatch mechanism that offers a flexible and type-safe approach to aspect reuse.
[1]
Ramnivas Laddad,et al.
Aspectj in Action: Practical Aspect-Oriented Programming
,
2003
.
[2]
Eric Bodden.
Closure joinpoints: block joinpoints without surprises
,
2011,
AOSD '11.
[3]
Andreas Paepcke.
Object-oriented programming: the CLOS perspective
,
1993
.
[4]
Jonathan Aldrich,et al.
Open Modules: Modular Reasoning About Advice
,
2005,
ECOOP.
[5]
Sven Apel,et al.
Types and modularity for implicit invocation with implicit announcement
,
2010,
TSEM.
[6]
Yuanyuan Song,et al.
Modular software design with crosscutting interfaces
,
2006,
IEEE Software.