The Essence of AspectJ

The Essence of AspectJ

Mark P. Jones. Technical Report. Department of Computer Science & Engineering, OGI School of Science & Engineering at OHSU, March 2001.


In the construction of a large software system, it is inevitable that some aspects of program behavior will cut across the structure of the code. The changes that are needed to support a new feature, for example, may be spread across several different points in the original program, making them harder to maintain and harder to reuse. The designers of ``aspect-oriented'' programming languages aim to tackle these problems by introducing new language mechanisms to capture cross-cutting concerns. Their hope is that this will allow different aspects of a program to be captured as independent entities that can be woven together automatically to produce a complete program.

In this paper, we focus on AspectJ, an aspect-oriented extension of Java that has been designed and implemented by a team at Xerox PARC to support an empirical assessment of aspect-oriented programming. The development of AspectJ has been driven largely by pragmatic concerns. Here, we provide a complimentary perspective by using interpreters, written in Haskell, to present a formal semantics for a simple aspect-oriented programming language, and so to distill the essence of AspectJ.

This paper provides a firm semantic foundation for the design of aspect-oriented programming languages. It illustrates the flexibility that can be obtained by writing interpreters in a monadic style, but also challenges us to contemplate how the ideas of aspect-oriented programming might be applied to the design of future functional languages.

Available by http in pdf.