ABSTRACT
An aspect observes the execution of a base program; when certain actions occur, the aspect runs some extra code of its own. In the AspectJ language, the observations that an aspect can make are confined to the current action: it is not possible to directly observe the history of a computation.Recently, there have been several interesting proposals for new history-based language features, most notably by Douence et al. and by Walker and Viggers. In this paper, we present a new history-based language feature called tracematches that enables the programmer to trigger the execution of extra code by specifying a regular pattern of events in a computation trace. We have fully designed and implemented tracematches as a seamless extension of AspectJ.A key innovation in our tracematch approach is the introduction of free variables in the matching patterns. This enhancement enables a whole new class of applications in which events can be matched not only by the event kind, but also by the values associated with the free variables. We provide several examples of applications enabled by this feature.After introducing and motivating the idea of tracematches via examples, we present a detailed semantics of our language design, and we derive an implementation from that semantics. The implementation has been realised as an extension of the abc compiler for AspectJ.
- abc. The AspectBench Compiler. Home page with downloads, FAQ, documentation, support mailing lists, and bug database. http://aspectbench.org.]]Google Scholar
- Thomas Ball, Byron Cook, Vladimir Levin, and Sriram K. Rajamani. SLAM and static driver verifier: Technology transfer of formal methods inside Microsoft. In Eerke Boiten, John Derrick, and Graeme Smith, editors, Integrated Formal Methods, pages 1--20, 2004.]]Google ScholarCross Ref
- Christoph Bockisch, Mira Mezini, and Klaus Ostermann. Quantifying over dynamic properties of program execcution. In 2nd Dynamic Aspects Workshop (DAW05), pages 71--75, 2005.]]Google Scholar
- Eric Bodden. Concern specific languages and their implementation with abc. SPLAT workshop at AOSD. Download: http://www.bodden.de/publications, 2005.]]Google Scholar
- María Augustina Cibrán and Bart Verheecke. Dynamic business rules for web service composition. In 2nd Dynamic Aspects Workshop (DAW05), pages 13--18, 2005.]]Google Scholar
- Adrian Colyer, Andy Clement, George Harley, and Matthew Webster. Eclipse AspectJ: Aspect-Oriented Programming with AspectJ and the Eclipse AspectJ development tools. Addison-Wesley, 2004.]]Google ScholarDigital Library
- R. Douence, P. Fradet, and M. Südholt. A framework for the detection and resolution of aspect interactions. In Proceedings of the ACM SIGPLAN/SIGSOFT Conference on Generative Programming and Component Engineering (GPCE'02), pages 173--188, 2002.]] Google ScholarDigital Library
- R. Douence, O. Motelet, and M. Sudholt. A formal definition of crosscuts. In Akinori Yonezawa and Satoshi Matsuoka, editors, Reflection 2001, volume 2192 of Lecture Notes in Computer Science, pages 170--186. Springer, 2001.]] Google ScholarDigital Library
- Rémi Douence, Pascal Fradet, and Mario Südholt. Composition, reuse and interaction analysis of stateful aspects. In Karl Lieberherr, editor, 3rd International Conference on Aspect-oriented Software Development, pages 141--150, 2004.]] Google ScholarDigital Library
- Remi Douence, Pascal Fradet, and Mario Südholt. Trace-based aspects. In Aspect-oriented Software Development, pages 141--150. Addison-Wesley, 2004.]]Google Scholar
- Rémi Douence, Thomas Fritz, Nicolas Loriant, Jean-Marc Menaud, Marc Ségura, and Mario Südholt. An expressive aspect language for system applications with arachne. In Aspect-Oriented Software Development, pages 27--38, 2005.]] Google ScholarDigital Library
- Thomas Fritz, Marc Ségura, Mario Südholt, Egon Wuchner, and Jean-Marc Menaud. An application of dynamic AOP to medical image generation. In 2nd Dynamic Aspects Workshop (DAW05), pages 5--12, 2005.]]Google Scholar
- Erich Gamma. JHotDraw. Available for download from http://sourceforge.net/projects/jhotdraw, 2004.]]Google Scholar
- Simon Goldsmith, Robert O'Callahan, and Alex Aiken. Relational queries over program traces. In Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications, 2005.]] Google ScholarDigital Library
- Joseph D. Gradecki and Nicholas Lesiecki. Mastering AspectJ: Aspect-Oriented Programming in Java. Wiley, 2003.]] Google ScholarDigital Library
- Seth Hallem, Benjamin Chelf, Yichen Xie, and Dawson Engler. A system and language for building system-specific, static analyses. In ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 69--82, 2002.]] Google ScholarDigital Library
- Jan Hannemann and Gregor Kiczales. Design pattern implementation in Java and AspectJ. In OOPSLA, pages 161--173, 2002.]] Google ScholarDigital Library
- Gregor Kiczales, Erik Hilsdale, Jim Hugunin, Mik Kersten, Jeffrey Palm, and William G. Griswold. An overview of AspectJ. In J. Lindskov Knudsen, editor, European Conference on Object-oriented Programming, volume 2072 of Lecture Notes in Computer Science, pages 327--353. Springer, 2001.]] Google ScholarDigital Library
- I. Kiselev. Aspect-oriented programming with AspectJ. SAMS, 2002.]] Google ScholarDigital Library
- Ramnivas Laddad. AspectJ in Action. Manning, 2003.]]Google Scholar
- Karl J. Lieberherr, Jeffrey Palm, and Ravi Sundaram. Expressiveness and complexity of crosscut languages. In Proceedings of the eth workshop on Foundations of Aspect-Oriented Languages (FOAL '05), 2005.]]Google Scholar
- Michael Martin, Benjamin Livshits, and Monica S. Lam. Finding application errors using PQL: a program query language. In Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications, 2005.]] Google ScholarDigital Library
- Hidehiko Masuhara, Gregor Kiczales, and Chris Dutchyn. A compilation and optimization model for aspect-oriented programs. In Compiler Construction, volume 2622 of Springer Lecture Notes in Computer Science, pages 46--60, 2003.]]Google ScholarDigital Library
- Russell Miles. AspectJ cookbook. O'Reilly, 2004.]] Google ScholarDigital Library
- Nathaniel Nystrom, Michael R. Clarkson, and Andrew C. Myers. Polyglot: An extensible compiler framework for Java. In 12th International Conference on Compiler Construction, volume 2622 of Lecture Notes in Computer Science, pages 138--152, 2003.]]Google ScholarDigital Library
- Klaus Ostermann, Mira Mezini, and Christoph Bockisch. Expressive pointcuts for increased modularity. In ECOOP, 2005.]]Google ScholarDigital Library
- Jens Palsberg, Boaz Patt-Shamir, and Karl J. Lieberherr. A new approach to compiling adaptive programs. Science of Computer Programming, 29(3):303--326, 1997.]] Google ScholarDigital Library
- Volker Stolz and Eric Bodden. Temporal Assertions using AspectJ. In Fifth Workshop on Runtime Verification (RV'05), Electronic Notes in Theoretical Computer Science. Elsevier Science Publishers, 2005.]]Google Scholar
- Raja Vallée-Rai, Etienne Gagnon, Laurie J. Hendren, Patrick Lam, Patrice Pominville, and Vijay Sundaresan. Optimizing Java bytecode using the Soot framework: Is it feasible? In Compiler Construction, 9th International Conference (CC 2000), pages 18--34, 2000.]] Google ScholarDigital Library
- Wim Vanderperren, Davy Suvé, María Augustina Cibrán, and Bruno De Fraine. Stateful aspects in JAsCo. In Workshop on Software Composition at ETAPS, 2005.]]Google ScholarDigital Library
- Robert Walker and Kevin Viggers. Implementing protocols via declarative event patterns. In ACM Sigsoft International Symposium on Foundations of Software Engineering (FSE-12), pages 159--169, 2004.]] Google ScholarDigital Library
Index Terms
- Adding trace matching with free variables to AspectJ
Recommendations
Adding trace matching with free variables to AspectJ
Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming systems languages and applicationsAn aspect observes the execution of a base program; when certain actions occur, the aspect runs some extra code of its own. In the AspectJ language, the observations that an aspect can make are confined to the current action: it is not possible to ...
Region pointcut for AspectJ
ACP4IS '09: Proceedings of the 8th workshop on Aspects, components, and patterns for infrastructure softwareThis paper proposes a new pointcut called region pointcut, which has the ability to pick out regions as join points. This pointcut allows programmers to modularize synchronization, exception handling and parallelization. Although these are typical ...
Adding open modules to AspectJ
AOSD '06: Proceedings of the 5th international conference on Aspect-oriented software developmentAspectJ does not provide a mechanism to hide implementation details from advice. As a result, aspects are tightly coupled to the implementation of the code they advise, while the behaviour of the base code is impossible to determine without analysing ...
Comments