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

Modularity first: a case for mixing AOP and attribute grammars

Published: 31 March 2008 Publication History

Abstract

We have reimplemented the frontend of the extensible AspectBench Compiler for AspectJ, using the aspect-oriented meta-compiler JastAdd. The original frontend was purely object-oriented. Each frontend extends Java with AspectJ and an additional set of pointcuts in a modular fashion. In this paper we give a detailed comparison of both approaches and show a number of advantages of using JastAdd: the implementation is half the size, twice as fast, concerns are better localised, extensions are composable, and computations are automatically scheduled.
JastAdd provides a very constrained form of static AOP where only inter-type declarations and method execution interception are supported. However, additional modularisation mechanisms from the compiler construction community are supported in the form of demand-driven evaluation and attribute grammars. Our implementation would not have benefited from a richer pointcut language, while both demand-drive evaluation and declarative attributes were essential in enabling composable extensions and flexible modularisation.
We believe that the AOP community at large can benefit from acknowledging demand-driven evaluation as an important modularisation mechanism. Also, reference attribute grammars enhance the extensible implementation of graphbased computations that rely on context-sensitive information.

References

[1]
Chris Allan, Pavel Avgustinov, Aske Simon Christensen, Laurie Hendren, Sascha Kuzins, Jennifer Lhoták, Ondřej Lhoták, Oege de Moor, Damien Sereni, Ganesh Sittampalam, and Julian Tibble. The AspectBench Compiler for AspectJ. In Generative Programming and Component Engineering, volume 3676 of LNCS, pages 10--16. Springer, 2005.
[2]
Chris Allan, Pavel Avgustinov, Aske Simon Christensen, Laurie Hendren, Sascha Kuzins, Ondřej Lhoták, Oege de Moor, Damien Sereni, Ganesh Sittampalam, and Julian Tibble. Adding Trace Matching with Free Variables to AspectJ. In Object-Oriented Programming, Systems, Languages and Applications, pages 345--364. ACM Press, 2005.
[3]
Tomoyuki Aotani and Hidehiko Masuhara. SCoPE: an AspectJ compiler for supporting user-defined analysis-based pointcuts. In AOSD, pages 161--172, 2007.
[4]
Pavel Avgustinov, Aske Simon Christensen, Laurie Hendren, Sascha Kuzins, Jennifer Lhoták, Ondřej Lhoták, Oege de Moor, Damien Sereni, Ganesh Sittampalam, and Julian Tibble. abc: An extensible AspectJ compiler. In Aspect-Oriented Software Development (AOSD), pages 87--98. ACM Press, 2005.
[5]
Christoph Bockisch and Mira Mezini. A flexible architecture for pointcut-advice language implementations. In VMIL '07: Proceedings of the 1st workshop on Virtual machines and intermediate languages for emerging modularization mechanisms, page 1, New York, NY, USA, 2007. ACM Press.
[6]
Martin Bravenboer, Éric Tanter, and Eelco Visser. Declarative, formal, and extensible syntax definition for aspectj. In Proceedings of OOPSLA '06, pages 209--228, New York, NY, USA, 2006. ACM Press.
[7]
Bryan Chadwick, Therapon Skotiniotis, and Karl Lieberherr. Functional Visitors Revisited. Technical Report NU-CCIS-06-03, Northeastern University, Boston, May 2006.
[8]
Torbjörn Ekman and Görel Hedin. Modular name analysis for Java using JastAdd. In Generative and Transformational Techniques in Software Engineering, International Summer School, GTTSE 2005, volume 4143 of LNCS. Springer, 2006.
[9]
Torbjörn Ekman and Görel Hedin. Pluggable checking and inferencing of non-null types for Java. Proceedings of TOOLS Europe 2007, Journal of Object Technology, 6(7), 2007.
[10]
Torbjörn Ekman and Görel Hedin. The JastAdd Extensible Java Compiler. In David Bacon, editor, Proceedings of OOPSLA 2007, 2007.
[11]
Erich Gamma. JHotDraw. Available from http://sourceforge.net/projects/jhotdraw, 2004.
[12]
Robert Grimm. Better extensibility through modular syntax. In PLDI '06: Proceedings of the 2006 ACM SIGPLAN conference on Programming language design and implementation, pages 38--51, New York, NY, USA, 2006. ACM Press.
[13]
Jan Hannemann and Gregor Kiczales. Design pattern implementation in Java and AspectJ. In OOPSLA, pages 161--173, 2002.
[14]
Bruno Harbulot and John R. Gurd. A join point for loops in AspectJ. In AOSD, pages 63--74, 2006.
[15]
Michael Hausl. An AspectJ Compiler for the Steamloom Virtual Machine. http://www.st.informatik.tu-darmstadt.de/pages/projects/ALIA/Frontend/ALIA_AJ_Compiler.pdf, 2007.
[16]
Görel Hedin. Reference Attributed Grammars. In Informatica (Slovenia), 24(3), pages 301--317, 2000.
[17]
Görel Hedin. Compiler Construction at Lund University, Sweden. http://www.cs.lth.se/EDA180/2006-web, 2006.
[18]
J. Hughes. Why Functional Programming Matters. Computer Journal, 32(2):98--107, 1989.
[19]
Gregor Kiczales. Introduction to Compiler Construction at University of British Columbia, Canada. http://http://www.cs.ubc.ca/~gregor/teaching/cpsc411/index.html, 2006.
[20]
Donald E. Knuth. Semantics of context-free languages. Mathematical Systems Theory, 2(2):127--145, June 1968. Correction: Mathematical Systems Theory 5, 1, pp. 95--96 (March 1971).
[21]
Sergei Kojarski and David H. Lorenz. AWESOME: A Co-Weaving System for Multiple Aspect-Oriented Extensions. In David Bacon, editor, Proceedings of OOPSLA 2007, 2007.
[22]
E. Magnusson and G. Hedin. Circular Reference Attributed Grammars - Their Evaluation and Applications. Electr. Notes Theor. Comput. Sci., 82(3), 2003.
[23]
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.
[24]
Damijan Rebernak, Marjan Mernik, Hui Wu, and Jeff Gray. Domain-Specific Aspect Languages for Modularizing Crosscutting Concerns in Grammars. In "Proceedings of Domain-Specific Aspect Languages Workshop at GPCE 2006", 2006.
[25]
Michael Schwartzbach. Compilation Course at Aarhus University, Denmark. http://www.brics.dk/~mis/dOvs, 2007.
[26]
Therapon Skotiniotis, Jeffrey Palm, and Karl J. Lieberherr. Demeter interfaces: Adaptive programming without surprises. In Dave Thomas, editor, ECOOP, volume 4067 of Lecture Notes in Computer Science, pages 477--500. Springer, 2006.
[27]
Raja Vallée-Rai, Phong Co, Etienne Gagnon, Laurie Hendren, Patrick Lam, and Vijay Sundaresan. Soot - a Java bytecode optimization framework. In CASCON '99: Proceedings of the 1999 conference of the Centre for Advanced Studies on Collaborative research, page 13. IBM Press, 1999.
[28]
Arie van Deursen, Leon Moonen, and Marius Marin. AJHotDraw. http://sourceforge.net/projects/ajhotdraw/, 2006.
[29]
Eelco Visser. Scannerless generalized-LR parsing. Technical Report P9707, Programming Research Group, University of Amsterdam, July 1997.
[30]
Phil Wadler. The expression problem. Posted on the Java Genericity mailing list, 1998.

Cited By

View all
  • (2018)ExtendJ: extensible Java compilerCompanion Proceedings of the 2nd International Conference on the Art, Science, and Engineering of Programming10.1145/3191697.3213798(234-235)Online publication date: 9-Apr-2018
  • (2018)Declarative rewriting through circular nonterminal attributesComputer Languages, Systems and Structures10.1016/j.cl.2015.08.00844:PA(3-23)Online publication date: 20-Dec-2018
  • (2015)JavaRAG: a Java library for reference attribute grammarsProceedings of the 14th International Conference on Modularity10.1145/2724525.2724572(55-67)Online publication date: 16-Mar-2015
  • Show More Cited By

Index Terms

  1. Modularity first: a case for mixing AOP and attribute grammars

      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

      Author Tags

      1. aspect-oriented programming
      2. extensible compilers
      3. modularity
      4. separation of concerns

      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
      • (2018)ExtendJ: extensible Java compilerCompanion Proceedings of the 2nd International Conference on the Art, Science, and Engineering of Programming10.1145/3191697.3213798(234-235)Online publication date: 9-Apr-2018
      • (2018)Declarative rewriting through circular nonterminal attributesComputer Languages, Systems and Structures10.1016/j.cl.2015.08.00844:PA(3-23)Online publication date: 20-Dec-2018
      • (2015)JavaRAG: a Java library for reference attribute grammarsProceedings of the 14th International Conference on Modularity10.1145/2724525.2724572(55-67)Online publication date: 16-Mar-2015
      • (2015)A Taxonomy of Domain-Specific Aspect LanguagesACM Computing Surveys10.1145/268502847:3(1-44)Online publication date: 17-Feb-2015
      • (2013)Extending the JastAdd extensible Java compiler to Java 7Proceedings of the 2013 International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and Tools10.1145/2500828.2500843(147-152)Online publication date: 11-Sep-2013
      • (2013)A design rule language for aspect-oriented programmingJournal of Systems and Software10.1016/j.jss.2013.03.10486:9(2333-2356)Online publication date: 1-Sep-2013
      • (2013)Object GrammarsSoftware Language Engineering10.1007/978-3-642-36089-3_2(4-23)Online publication date: 2013
      • (2013)Circular Higher-Order Reference Attribute GrammarsSoftware Language Engineering10.1007/978-3-319-02654-1_17(302-321)Online publication date: 2013
      • (2010)An architecture for composing embedded domain-specific languagesProceedings of the 9th International Conference on Aspect-Oriented Software Development10.1145/1739230.1739237(49-60)Online publication date: 15-Mar-2010
      • (2009)Untangling crosscutting concerns in domain-specific languages with domain-specific join pointsProceedings of the 4th workshop on Domain-specific aspect languages10.1145/1509307.1509309(1-6)Online publication date: 3-Mar-2009
      • 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