Aspect-oriented programming lets programmers modularize concerns that are orthogonal to the main decomposition of a program. To do this, aspect-oriented programming includes modules called aspects that may modify the behavior, or advise, code in the main decomposition. Aspect-oriented programming also allows aspects to declaratively specify what code should be advised. This means that a whole-program search is required to find all the aspects that might advise a given piece of code. The problems this causes are somewhat analogous to overriding methods and polymorphic method dispatch in traditional object-oriented programming.
In object-oriented programming, the discipline of behavioral subtyping permits reasoning about polymorphic methods even when overriding methods remain unseen. The discipline gives guidance to the author of an overriding method: the overriding method must satisfy the specification of the overridden, superclass method. If the author follows the discipline, then other programmers can reason about a method invocation based on the specification of the superclass method, even if an unseen overriding method might actually be executed.
This dissertation describes an analogous discipline for aspect-oriented programming. The basic premise is that modular reasoning about aspect-oriented programs requires shared responsibility between the aspect author and the client programmer, whose code might be advised by the aspect.
To mediate this sharing, this dissertation proposes that aspects be categorized into two sorts: “spectators” and “assistants”. Spectators are statically restricted to not modify the behavior of the code that they advise. Because of their restricted behavior, spectators may remain unseen by the client programmer. The burden is on the aspect programmer to ensure that spectators satisfy their restrictions. Unlike spectators, assistants are not restricted in their behavior. The burden of reasoning about their effects falls to the client programmer. To do this, the client programmer must be able to identify all applicable assistants. Thus, assistants must be explicitly accepted by the advised code. This discipline allows modular reasoning, permits the use of existing aspect-oriented idioms, and appears to be practical and statically verifiable. A formal study demonstrates that the restrictions on spectators may be statically checked.
Cited By
- Barthe G and Kunz C Certificate translation for specification-preserving advices Proceedings of the 7th workshop on Foundations of aspect-oriented languages, (9-18)
- Mostefaoui F and Vachon J Verification of Aspect-UML models using alloy Proceedings of the 10th international workshop on Aspect-oriented modeling, (41-48)
- Cameron N, Drossopoulou S, Noble J and Smith M (2007). Multiple ownership, ACM SIGPLAN Notices, 42:10, (441-460), Online publication date: 21-Oct-2007.
- Clifton C, Leavens G and Noble J MAO Proceedings of the 21st European conference on Object-Oriented Programming, (451-475)
- Cameron N, Drossopoulou S, Noble J and Smith M Multiple ownership Proceedings of the 22nd annual ACM SIGPLAN conference on Object-oriented programming systems, languages and applications, (441-460)
- Lopez-Herrejon R, Batory D and Lengauer C A disciplined approach to aspect composition Proceedings of the 2006 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation, (68-77)
Index Terms
- A design discipline and language features for modular reasoning in aspect-oriented programs
Recommendations
Join point interfaces for modular reasoning in aspect-oriented programs
ESEC/FSE '11: Proceedings of the 19th ACM SIGSOFT symposium and the 13th European conference on Foundations of software engineeringWhile 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 ...
Experimental aspect-oriented language - AspectCOOL
SAC '02: Proceedings of the 2002 ACM symposium on Applied computingAspect-oriented programming (AOP) is a programming technique for modularizing concerns that crosscut the basic functionality of programs. In AOP, aspect languages are used to describe properties, which crosscut basic functionality, in a clean and a ...
Modular aspect-oriented design with XPIs
The emergence of aspect-oriented programming (AOP) languages has provided software designers with new mechanisms and strategies for decomposing programs into modules and composing modules into systems. What we do not yet fully understand is how best to ...