skip to main content
article

Semantics of static pointcuts in aspectJ

Published:17 January 2007Publication History
Skip Abstract Section

Abstract

In aspect-oriented programming, one can intercept events by writing patterns called pointcuts. The pointcut language of the most popular aspect-oriented programming language, AspectJ, allows the expression of highly complex properties of the static program structure.We present the first rigorous semantics of the AspectJ pointcut language, by translating static patterns into safe ( i.e. range-restricted and stratified) Datalog queries. Safe Datalog is a logic language like Prolog, but it does not have data structures; consequently it has a straightforward least fixpoint semantics and all queries terminate.The translation from pointcuts to safe Datalog consists of a set of simple conditional rewrite rules, implemented using the Stratego system. The resulting queries are themselves executable with the CodeQuest system. We present experiments indicating that direct execution of our semantics is not prohibitively expensive.

References

  1. abc. The AspectBench Compiler. Home page with downloads, FAQ, documentation, support mailing lists, and bug database. http://aspectbench.org.]]Google ScholarGoogle Scholar
  2. Jonathan Aldrich. Open Modules: modular reasoning about advice. In Andrew P. Black, editor, Proceedings of ECOOP 2005, volume 3586 of Lecture Notes in Computer Science, pages 144--168. Springer, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. James H. Andrews. Process-algebraic foundations of aspect-oriented programming. In Akinori Yonezawa and Satoshi Matsuoka, editors, REFLECTION, volume 2192 of Lecture Notes in Computer Science, pages 187--209. Springer, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. AspectJ Eclipse home page. http://eclipse.org/aspectj/, 2003.]]Google ScholarGoogle Scholar
  5. Pavel Avgustinov, Aske Simon Christensen, Laurie Hendren, Sascha Kuzins, Jennifer Lhoták, Ondvrej Lhoták, Oege de Moor, Damien Sereni, Ganesh Sittampalam, and Julian Tibble. abc: An extensible AspectJ compiler. In Proceedings of AOSD, pages 87--98. ACM Press, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Pavel Avgustinov, Elnar Hajiyev, Neil Ongkingco, Oege de Moor, Damien Sereni, Julian Tibble, and Mathieu Verbaere. Datalog Semantics of Static Pointcuts in AspectJ 1.2.1. Technical Report abc-2006-2, AspectBench Compiler Project, 2006. http://aspectbench.org/techreports#abc-2006-2.]]Google ScholarGoogle Scholar
  7. Ohad Barzilay, Yishai A. Feldman, Shmuel Tyszberowicz, and Amiram Yehudai. Call and execution semantics in AspectJ. In Curtis Clifton, Ralf Lämmel, and Gary T. Leavens, editors, FOAL, pages 19--24, 2004. Technical report TR #04-04, Department of Computer Science, Iowa State University.]]Google ScholarGoogle Scholar
  8. Ron Bodkin. Pointcuts need a long form. http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg05971.html, 2006.]]Google ScholarGoogle Scholar
  9. Martin Bravenboer, Eric Tanter, and Eelco Visser. Declarative, formal, and extensible syntax definition for AspectJ --- a case for scannerless generalized-LR parsing. In William Cook, editor, Proceedings of OOPSLA, page to appear. ACM Press, 2006.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Glenn Bruns, Radha Jagadeesan, Alan Jeffrey, and James Riely. μABC: a minimal aspect calculus. In Philippa Gardner and Nobuko Yoshida, editors, Proceedings of CONCUR, volume 3170 of Lecture Notes in Computer Science, pages 209--224. Springer, 2004.]]Google ScholarGoogle Scholar
  11. Bill Burke. has and hasfield pointcut expressions. http://aosd.net/pipermail/discuss_aosd.net/2004-May/000958.html, 2004.]]Google ScholarGoogle Scholar
  12. Luca Cardelli, Florian Matthes, and Martín Abadi. Extensible grammars for language specialization. In Catriel Beeri, Atsushi Ohori, and Dennis Shasha, editors, Database Programming Languages, pages 11--31. Springer, 1993.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Daniel S. Dantas and David Walker. Harmless advice. In Conference record of POPL, pages 383--396. ACM Press, 2006.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Daniel S. Dantas, David Walker, Geoffrey Washburn, and Stephanie Weirich. PolyAML: a polymorphic aspect-oriented functional programming language. In Benjamin Pierce, editor, Proceedings of ICFP, pages 306--319. ACM Press, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Stephen Dawson, C. R. Ramakrishnan, and David Scott Warren. Practical program analysis using general purpose logic programming systems. In Kathryn S. McKinley, editor, Proceedings of PLDI, pages 117--126. ACM Press, 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Kris de Volder. Aspect-oriented logic meta-programming. In Pierre Cointe, editor, REFLECTION, volume 1616 of Lecture Notes in Computer Science, pages 250--272. Springer, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Hervé Gallaire and Jack Minker. Logic and Databases. Plenum Press, New York, 1978.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Erich Gamma. JHotDraw. Available from http://sourceforge.net/projects/jhotdraw, 2004.]]Google ScholarGoogle Scholar
  19. William G. Griswold, Kevin Sullivan, Yuanyuan Song, Macneil Shonle, Nishit Tewari, Yuanfang Cai, and Hridesh Rajan. Modular software design with crosscutting interfaces. IEEE Software, 23(1):51--60, 2006.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Kris Gybels and Johan Brichau. Arranging language features for more robust pattern-based crosscuts. In Proceedings of AOSD, pages 60--69. ACM Press, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Elnar Hajiyev, Mathieu Verbaere, and Oege de Moor. CodeQuest: scalable source code queries with Datalog. In Dave Thomas, editor, Proceedings of ECOOP, volume 4067 of Lecture Notes in Computer Science, pages 2--27. Springer, 2006.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Erik Hilsdale and Jim Hugunin. Advice weaving in AspectJ. In Karl Lieberherr, editor, Proceedings of AOSD, pages 26--35. ACM Press, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Jim Hugunin. Support for modifiers in typepatterns. http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg01578.html, 2003.]]Google ScholarGoogle Scholar
  24. Peter Hui and James Riely. Temporal aspects as security automata. In Curtis Clifton, Ralf Lämmel, and Gary T. Leavens, editors, FOAL workshop at AOSD, Technical Report #06-01, pages 19--28. Iowa State University, 2006.]]Google ScholarGoogle Scholar
  25. Wes Isberg. Type patterns shouldn't match arbitrary suffixes. Bug report: https://bugs.eclipse.org/bugs/show_bug.cgi?id=141133, 2006.]]Google ScholarGoogle Scholar
  26. Radha Jagadeesan, Alan Jeffrey, and James Riely. A calculus of untyped aspect-oriented programs. In Luca Cardelli, editor, Proceedings of ECOOP, volume 2743 of Lecture Notes in Computer Science, pages 54--73. Springer, 2003.]]Google ScholarGoogle Scholar
  27. Radha Jagadeesan, Alan Jeffrey, and James Riely. Typed parametric polymorphism for aspects. Science of Computer Programming, To appear, 2006.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Gregor Kiczales, Erik Hilsdale, Jim Hugunin, Mik Kersten, Jeffrey Palm, and William G. Griswold. An overview of AspectJ. In J. Lindskov Knudsen, editor, Proceedings of ECOOP, volume 2072 of Lecture Notes in Computer Science, pages 327--353. Springer, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Günter Kniesel, Tobias Rho, and Stefan Hanenberg. Evolvable pattern implementations need generic aspects. In ECOOP Workshop on Reflection, AOP and Meta-Data for Software Evolution, pages 116--126. 2004.]]Google ScholarGoogle Scholar
  30. Ramnivas Laddad. AspectJ in Action. Manning, 2003.]]Google ScholarGoogle Scholar
  31. Monica S. Lam, John Whaley, V. Benjamin Livshits, Michael C. Martin, Dzintars Avots, Michael Carbin, and Christopher Unkel. Context-sensitive program analysis as database queries. In Proceedings of PODS, pages 1--12. ACM Press, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Ralf Lämmel. A semantical approach to method-call interception. In Proceedings of AOSD, pages 41--55. ACM Press, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Hidehiko Masuhara and Kazunori Kawauchi. Dataflow pointcut in aspect-oriented programming. In Atsushi Ohori, editor, Proceedings of APLAS, volume 2895 of Lecture Notes in Computer Science, pages 105--121. Springer, 2003.]]Google ScholarGoogle Scholar
  34. Hidehiko Masuhara, Gregor Kiczales, and Chris Dutchyn. A compilation and optimization model for aspect-oriented programs. In Görel Hedin, editor, Compiler Construction, volume 2622 of Lecture Notes in Computer Science, pages 46--60. Springer, 2003.]]Google ScholarGoogle Scholar
  35. Edward McCormick and Kris De Volder. JQuery: finding your way through tangled code. In Companion to OOPSLA, pages 9--10. ACM Press, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Hridesh Rajan and Kevin J. Sullivan. Classpects: unifying aspect- and object-oriented language design. In Proceedings of ICSE, pages 59--68. ACM Press, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Thomas W. Reps. Demand interprocedural program analysis using logic databases. In Raghu Ramakrishnan, editor, Applications of Logic Databases, volume 296 of International Series in Engineering and Computer Science, pages 163--196. Kluwer, 1995.]]Google ScholarGoogle Scholar
  38. Konstantinos Sagonas, Terrance Swift, and David S. Warren. XSB as an efficient deductive database engine. In Richard Thomas Snodgrass and Marianne Winslett, editors, SIGMOD, pages 442--453. ACM Press, 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Peri L. Tarr, Harold Ossher, and Stanley M. Sutton. Hyper/J: multi-dimensional separation of concerns for Java. In Proceedings of ICSE, pages 689--690. ACM Press, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. David B. Tucker and Shriram Krishnamurthi. Pointcuts and advice in higher-order languages. In Mehmet Akşit, editor, Proceedings of AOSD, pages 158--167. ACM Press, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Eelco Visser. Meta-programming with concrete object syntax. In Don S. Batory, Charles Consel, and Walid Taha, editors, Proceedings of GPCE, volume 2487 of Lecture Notes in Computer Science, pages 299--315. Springer, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. w3c. Jigsaw. http://www.w3.org/Jigsaw/, 2006.]]Google ScholarGoogle Scholar
  43. David Walker, Steve Zdancewic, and Jay Ligatti. A theory of aspects. In Colin Runciman and Olin Shivers, editors, Proceedings of ICFP, pages 127--139. ACM Press, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Dean Wampler. Humane pointcut languages. http://blog.aspectprogramming.com/articles/2006/04/21/, 2006.]]Google ScholarGoogle Scholar
  45. Mitchell Wand, Gregor Kiczales, and Christopher Dutchyn. A semantics for advice and dynamic join points in aspect-oriented programming. ACM Trans. Program. Lang. Syst., 26(5):890--910, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Meng Wang, Kung Chen, and Siau-Cheng Khoo. On the pursuit of static and coherent weaving. In Curtis Clifton, Ralf Lämmel, and Gary T. Leavens, editors, FOAL, number TR #$06-01 in Technical Report, pages 43--52, 2006.]]Google ScholarGoogle Scholar
  47. Meng Wang, Kung Chen, and Siau-Cheng Khoo. Type-directed weaving of aspects for higher-order functional languages. In John Hatcliff and Frank Tip, editors, Proceedings of PEPM, pages 78--87. ACM Press, 2006.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. John Whaley, Dzintars Avots, Michael Carbin, and Monica S. Lam. Using datalog and binary decision diagrams for program analysis. In Kwangkeun Yi, editor, Proceedings of APLAS, volume 3780 of Lecture Notes in Computer Science, pages 97--118. Springer, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Ian H. Witten and Eibe Frank. Data Mining: Practical Machine Learning Tools and Techniques with Java implementations. Morgan Kaufmann Publishers, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Semantics of static pointcuts in aspectJ

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 42, Issue 1
        Proceedings of the 2007 POPL Conference
        January 2007
        379 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1190215
        Issue’s Table of Contents
        • cover image ACM Conferences
          POPL '07: Proceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
          January 2007
          400 pages
          ISBN:1595935754
          DOI:10.1145/1190216

        Copyright © 2007 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 17 January 2007

        Check for updates

        Qualifiers

        • article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!