|
ABSTRACT
AspectJ was designed as a seamless aspect-oriented extension of the Java programming language. However, unlike Java, AspectJ does not have a safe type system: an accepted binding between a pointcut and an advice can give rise to type errors at runtime. In addition, AspectJ's typing rules severely restrict the definition of certain generic advice behavior. In this paper, we analyze the roots of these type errors, and describe measures to recover type safety for both generic and non-generic pointcut/advice declarations. Pointcuts quantify over heterogeneous sets of join points and are hence typed using type ranges in our approach, while type variables and a dual advice signature allow to express the generic and invasive nature of advices. Using these mechanisms, we can express advice that augments, narrows or replaces base functionality in possibly generic contexts. As a language engineering contribution, we integrate our proposal with the AspectJ language, and we provide a prototype implementation as a plugin for the AspectBench Compiler (abc). On a theoretical level, we present a formal definition of the proposed constructs and typing rules, and develop proofs for their type safety properties.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
M. Akşit, editor. Proc. 2nd Int' Conf. on Aspect-Oriented Software Development (AOSD-2003). ACM Press, Mar. 2003.
|
 |
2
|
Pavel Avgustinov , Aske Simon Christensen , Laurie Hendren , Sascha Kuzins , Jennifer Lhoták , Ondřej Lhoták , Oege de Moor , Damien Sereni , Ganesh Sittampalam , Julian Tibble, abc: an extensible AspectJ compiler, Proceedings of the 4th international conference on Aspect-oriented software development, p.87-98, March 14-18, 2005, Chicago, Illinois
[doi> 10.1145/1052898.1052906]
|
 |
3
|
Gilad Bracha , David Griswold, Strongtalk: typechecking Smalltalk in a production environment, Proceedings of the eighth annual conference on Object-oriented programming systems, languages, and applications, p.215-230, September 26-October 01, 1993, Washington, D.C., United States
|
 |
4
|
Gilad Bracha , Martin Odersky , David Stoutamire , Philip Wadler, Making the future safe for the past: adding genericity to the Java programming language, Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, p.183-200, October 18-22, 1998, Vancouver, British Columbia, Canada
|
 |
5
|
|
| |
6
|
|
| |
7
|
A. Colyer. Implementing caching with AspectJ. Blog entry: http://www.aspectprogrammer.org/blogs/adrian/, June 2004.
|
| |
8
|
A. Colyer et al. The AspectJ development environment guide. Available at http://www.eclipse.org/aspectj/doc/released/devguide/, 2002.
|
| |
9
|
A. Colyer et al. The AspectJ 5 development kit developer's notebook. Available at http://www.eclipse.org/aspectj/doc/released/adk15notebook/, Dec. 2005.
|
| |
10
|
B. De Fraine, M. Südholt, and V. Jonckers. Formal semantics of flexible and safe pointcut/advice bindings. Technical Report SSEL 02/2007/a, Vrije Universiteit Brussel, Oct. 2007. Available at http://ssel.vub.ac.be/files/formal07a.pdf.
|
 |
11
|
|
| |
12
|
E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns. Addison-Wesley, 1995.
|
| |
13
|
|
 |
14
|
|
 |
15
|
Jan Hannemann , Gregor Kiczales, Design pattern implementation in Java and aspectJ, Proceedings of the 17th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, November 04-08, 2002, Seattle, Washington, USA
|
 |
16
|
Atshushi Igarashi , Benjamin Pierce , Philip Wadler, Featherwieght Java: a minimal core calculus for Java and GJ, Proceedings of the 14th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, p.132-146, November 01-05, 1999, Denver, Colorado, United States
|
| |
17
|
|
| |
18
|
R. Johnson et al. Spring Java/J2EE Application Framework. Home page at http://www.springframework.org/, 2004.
|
| |
19
|
Gregor Kiczales , Erik Hilsdale , Jim Hugunin , Mik Kersten , Jeffrey Palm , William G. Griswold, An Overview of AspectJ, Proceedings of the 15th European Conference on Object-Oriented Programming, p.327-353, June 18-22, 2001
|
| |
20
|
|
| |
21
|
|
| |
22
|
D. Lohmann, G. Blaschke, and O. Spinczyk. Generic advice: On the combination of AOP with generative programming in AspectC++. In Proc. of GPCE'04, volume 3286 of Springer-Verlag Lecture Notes in Computer Science, pages 55--74. Springer, Oct. 2004.
|
 |
23
|
|
| |
24
|
|
| |
25
|
Object Management Group. Unified Modeling Language 2.0 Superstructure Specification, Feb. 2005.
|
 |
26
|
|
| |
27
|
R. Pawlak, R. Johnson, A. Popovici, et al. AOP Alliance (Java/J2EE AOP standard) version 1.0. Home page at http://aopalliance.sourceforge.net/, Mar. 2004.
|
 |
28
|
|
 |
29
|
|
 |
30
|
Mads Torgersen , Christian Plesner Hansen , Erik Ernst , Peter von der Ahé , Gilad Bracha , Neal Gafter, Adding wildcards to the Java programming language, Proceedings of the 2004 ACM symposium on Applied computing, March 14-17, 2004, Nicosia, Cyprus
[doi> 10.1145/967900.968162]
|
 |
31
|
|
|