Modularity first: a case for mixing AOP and attribute grammars

  • Authors:
  • Pavel Avgustinov;Torbjörn Ekman;Julian Tibble

  • Affiliations:
  • University of Oxford, United Kingdom;University of Oxford, United Kingdom;University of Oxford, United Kingdom

  • Venue:
  • Proceedings of the 7th international conference on Aspect-oriented software development
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

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.