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.
- abc. The AspectBench Compiler. Home page with downloads, FAQ, documentation, support mailing lists, and bug database. http://aspectbench.org.]]Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- AspectJ Eclipse home page. http://eclipse.org/aspectj/, 2003.]]Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
- Ron Bodkin. Pointcuts need a long form. http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg05971.html, 2006.]]Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
- Bill Burke. has and hasfield pointcut expressions. http://aosd.net/pipermail/discuss_aosd.net/2004-May/000958.html, 2004.]]Google Scholar
- 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 Scholar
Digital Library
- Daniel S. Dantas and David Walker. Harmless advice. In Conference record of POPL, pages 383--396. ACM Press, 2006.]] Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Hervé Gallaire and Jack Minker. Logic and Databases. Plenum Press, New York, 1978.]] Google Scholar
Digital Library
- Erich Gamma. JHotDraw. Available from http://sourceforge.net/projects/jhotdraw, 2004.]]Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Erik Hilsdale and Jim Hugunin. Advice weaving in AspectJ. In Karl Lieberherr, editor, Proceedings of AOSD, pages 26--35. ACM Press, 2004.]] Google Scholar
Digital Library
- Jim Hugunin. Support for modifiers in typepatterns. http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg01578.html, 2003.]]Google Scholar
- 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 Scholar
- Wes Isberg. Type patterns shouldn't match arbitrary suffixes. Bug report: https://bugs.eclipse.org/bugs/show_bug.cgi?id=141133, 2006.]]Google Scholar
- 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 Scholar
- Radha Jagadeesan, Alan Jeffrey, and James Riely. Typed parametric polymorphism for aspects. Science of Computer Programming, To appear, 2006.]] Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- Ramnivas Laddad. AspectJ in Action. Manning, 2003.]]Google Scholar
- 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 Scholar
Digital Library
- Ralf Lämmel. A semantical approach to method-call interception. In Proceedings of AOSD, pages 41--55. ACM Press, 2002.]] Google Scholar
Digital Library
- 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 Scholar
- 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 Scholar
- Edward McCormick and Kris De Volder. JQuery: finding your way through tangled code. In Companion to OOPSLA, pages 9--10. ACM Press, 2004.]] Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- w3c. Jigsaw. http://www.w3.org/Jigsaw/, 2006.]]Google Scholar
- 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 Scholar
Digital Library
- Dean Wampler. Humane pointcut languages. http://blog.aspectprogramming.com/articles/2006/04/21/, 2006.]]Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Ian H. Witten and Eibe Frank. Data Mining: Practical Machine Learning Tools and Techniques with Java implementations. Morgan Kaufmann Publishers, 2000.]] Google Scholar
Digital Library
Index Terms
Semantics of static pointcuts in aspectJ
Recommendations
Semantics of static pointcuts in aspectJ
POPL '07: Proceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languagesIn 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 ...
From Datalog to flix: a declarative language for fixed points on lattices
PLDI '16We present Flix, a declarative programming language for specifying and solving least fixed point problems, particularly static program analyses. Flix is inspired by Datalog and extends it with lattices and monotone functions. Using Flix, implementors ...
Datalog as a pointcut language in aspect-oriented programming
OOPSLA '06: Companion to the 21st ACM SIGPLAN symposium on Object-oriented programming systems, languages, and applicationsAspectJ's pointcut language is complex, yet often not expressive enough to directly capture a desired property. Prolog has been suggested as an alternative, but Prolog queries may not terminate, and they tend to be verbose. We solve expressiveness, ...






Comments