Skip to content
Sections
Personal tools
You are here: Home Members Damien Sereni Research Projects Aspect-Oriented Programming
Document Actions

Aspect-Oriented Programming

Last modified 08 March 2008

Aspect-Oriented Programming is a novel programming paradigm that helps with modularisation of concerns that would not fit neatly into an object-oriented structure. Conceptually, an aspect monitors the execution of the program, and triggers extra code when certain run-time events are met.

Most of my work on aspects was in the context of the abc compiler for AspectJ, an extensible compiler and language workbench for experimenting with language design and optimisations.

Efficient Implementation

Some constructs in aspect-oriented programs require the dynamic state of the program to be monitored at runtime, to determine whether certain events occur (which would trigger extra behaviour). This can lead to expensive bookkeeping at runtime, and substantial overhead.

We have shown how to efficiently implement one such construct, the cflow pointcut. Two strategies are offered: better code generation techniques, which dramatically reduce the overhead of this pointcut; and a static analysis to eliminate runtime monitoring entirely wherever possible.

Both are implemented in the abc compiler; in addition our code generation strategies were adopted by the ajc compiler.

Trace Monitoring

AspectJ allows the programmer to write patterns on the state of the execution, and to execute advice when the state satisfies these patterns. State alone is insufficient to capture all properties of interest, however. We have proposed an extension of AspectJ to add trace monitoring, where the entire execution history of the program is made available.

My work on trace monitoring was concerned with the semantics of trace patterns. Since then, work on trace matching has continued, in particular to achieve efficient implementation (this is the work of Pavel Avgustinov and Julian Tibble, supervised by Oege de Moor).

Semantics of Pointcuts

The pointcut language in AspectJ allows concise specification, but is complex and has many subtle features. We have proposed the first semantics of pointcuts, by translating AspectJ pointcuts to the Datalog query language. In doing so we have clarified the language design and exposed bugs in both abc and ajc.

In addition, as the semantics is defined by translation down to Datalog queries, the semantics is executable. We have shown that this can lead to a feasible implementation of the pointcut language generated from a declarative specification.

References

 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: