skip to main content
10.1145/1353482.1353491acmotherconferencesArticle/Chapter ViewAbstractPublication PagesmodularityConference Proceedingsconference-collections
research-article

StrongAspectJ: flexible and safe pointcut/advice bindings

Published: 31 March 2008 Publication History

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

[1]
M. Akşit, editor. Proc. 2nd Int' Conf. on Aspect-Oriented Software Development (AOSD-2003). ACM Press, Mar. 2003.
[2]
P. Avgustinov, A. S. Christensen, L. Hendren, et al. abc: An extensible AspectJ compiler. In P. Tarr, editor, Proc. 4rd Int' Conf. on Aspect-Oriented Software Development (AOSD-2005), pages 87--98. ACM Press, Mar. 2005.
[3]
G. Bracha and D. Griswold. Strongtalk: typechecking Smalltalk in a production environment. In Proc. of OOPSLA '93, pages 215--230. ACM Press, 1993.
[4]
G. Bracha, M. Odersky, D. Stoutamire, and P. Wadler. Making the future safe for the past: Adding genericity to the Java programming language. In Proc. of OOPSLA '98, pages 183--200. ACM Press, Oct. 1998.
[5]
L. Cardelli and P. Wegner. On understanding types, data abstraction, and polymorphism. ACM Computing Surveys, 17(4):471--522, Dec. 1985.
[6]
C. Clifton and G. T. Leavens. MiniMAO1: An imperative core language for studying aspect-oriented reasoning. Science of Computer Programming, 63(3):321--374, 2006.
[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]
E. Ernst and D. H. Lorenz. Aspects and polymorphism in AspectJ. In Akşit {1}, pages 150--157.
[12]
E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns. Addison-Wesley, 1995.
[13]
J. Gosling, B. Joy, G. Steele, and G. Bracha. The Java Language Specification. Addison-Wesley Professional, third edition, June 2005.
[14]
S. Hanenberg and R. Unland. Parametric introductions. In Akşit {1}, pages 80--89.
[15]
J. Hannemann and G. Kiczales. Design pattern implementation in Java and AspectJ. In Proc. of OOPSLA '02, pages 161--173. ACM Press, 2002.
[16]
A. Igarashi, B. Pierce, and P. Wadler. Featherweight Java: A minimal core calculus for Java and GJ. In Proc. of OOPSLA '99, pages 132--146. ACM Press, Oct. 1999.
[17]
R. Jagadeesan, A. Jeffrey, and J. Riely. Typed parametric polymorphism for aspects. Science of Computer Programming, 63(3):267--296, 2006.
[18]
R. Johnson et al. Spring Java/J2EE Application Framework. Home page at http://www.springframework.org/, 2004.
[19]
G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An overview of AspectJ. In J. L. Knudsen, editor, Proc. ECOOP 2001, LNCS 2072, pages 327--353, Berlin, June 2001. Springer-Verlag.
[20]
R. Laddad. AspectJ in Action: Practical Aspect-Oriented Programming. Manning, 2003.
[21]
J. Ligatti, D. Walker, and S. Zdancewic. A type-theoretic interpretation of pointcuts and advice. Science of Computer Programming, 63(3):240--266, 2006.
[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]
H. Masuhara, H. Tatsuzawa, and A. Yonezawa. Aspectual Caml: an aspect-oriented functional language. In Proc. of ICFP '05, pages 320--330. ACM Press, 2005.
[24]
M. Naftalin and P. Wadler. Java Generics and Collections. O'Reilly Media, Inc., Oct. 2006.
[25]
Object Management Group. Unified Modeling Language 2.0 Superstructure Specification, Feb. 2005.
[26]
K. Ostermann and M. Mezini. Conquering aspects with Caesar. In Akşit {1}, pages 90--99.
[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]
M. Rinard, A. Salcianu, and S. Bugrara. A classification system and analysis for interactions in aspect-oriented programs. In Foundations of Software Engineering (FSE), pages 147--158. ACM, Oct. 2004.
[29]
D. Suvée and W. Vanderperren. JAsCo: An aspect-oriented approach tailored for component based software development. In Akşit {1}, pages 21--29.
[30]
M. Torgersen, C. P. Hansen, E. Ernst, P. von der Ahé, G. Bracha, and N. M. Gafter. Adding wildcards to the Java programming language. In H. Haddad, A. Omicini, R. L. Wainwright, and L. M. Liebrock, editors, Proc. of the 2004 ACM Symposium on Applied Computing (SAC), pages 1289--1296. ACM Press, 2004.
[31]
M. Wand, G. Kiczales, and C. Dutchyn. A semantics for advice and dynamic join points in aspect-oriented programming. ACM Transactions on Programming Languages and Systems (TOPLAS), 26(5):890--910, 2004.

Cited By

View all
  • (2019)Inference rules for generic code migration of aspect-oriented programsScience of Computer Programming10.1016/j.scico.2012.09.00478:8(1157-1175)Online publication date: 1-Jan-2019
  • (2019)Compositional type checking of delta-oriented software product linesActa Informatica10.1007/s00236-012-0173-z50:2(77-122)Online publication date: 2-Jan-2019
  • (2014)Join point interfaces for safe and flexible decoupling of aspectsACM Transactions on Software Engineering and Methodology (TOSEM)10.1145/255993323:1(1-41)Online publication date: 20-Feb-2014
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
AOSD '08: Proceedings of the 7th international conference on Aspect-oriented software development
March 2008
212 pages
ISBN:9781605580449
DOI:10.1145/1353482
  • Conference Chair:
  • Theo D'Hondt
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

  • AOSA: Aspect-Oriented Software Association

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 31 March 2008

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Research-article

Conference

AOSD08
Sponsor:
  • AOSA

Acceptance Rates

Overall Acceptance Rate 41 of 139 submissions, 29%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 19 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2019)Inference rules for generic code migration of aspect-oriented programsScience of Computer Programming10.1016/j.scico.2012.09.00478:8(1157-1175)Online publication date: 1-Jan-2019
  • (2019)Compositional type checking of delta-oriented software product linesActa Informatica10.1007/s00236-012-0173-z50:2(77-122)Online publication date: 2-Jan-2019
  • (2014)Join point interfaces for safe and flexible decoupling of aspectsACM Transactions on Software Engineering and Methodology (TOSEM)10.1145/255993323:1(1-41)Online publication date: 20-Feb-2014
  • (2014)Effective Aspects: A Typed Monadic Embedding of Pointcuts and AdviceTransactions on Aspect-Oriented Software Development XI10.1007/978-3-642-55099-7_5(145-192)Online publication date: 2014
  • (2013)A brief tour of join point interfacesProceedings of the 12th annual international conference companion on Aspect-oriented software development10.1145/2457392.2457401(19-22)Online publication date: 24-Mar-2013
  • (2013)A typed monadic embedding of aspectsProceedings of the 12th annual international conference on Aspect-oriented software development10.1145/2451436.2451457(171-184)Online publication date: 24-Mar-2013
  • (2012)Essential AOPACM Transactions on Programming Languages and Systems10.1145/2362389.236239134:3(1-43)Online publication date: 5-Nov-2012
  • (2012)A per-type instantiation mechanism for generic aspectsProceedings of the 3rd international workshop on Variability & Composition10.1145/2161996.2162003(25-30)Online publication date: 26-Mar-2012
  • (2011)Harmless compiler pluginsProceedings of the 13th Workshop on Formal Techniques for Java-Like Programs10.1145/2076674.2076678(1-6)Online publication date: 25-Jul-2011
  • (2011)Featherweight EventCJProceedings of the 3rd ACM International Workshop on Context-Oriented Programming10.1145/2068736.2068737(1-7)Online publication date: 25-Jul-2011
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media