What is Aspect-Oriented Programming and why is it important?
Aspect-oriented programming offers a new set of language features to improve
modularity. These features fall into two categories: open classes (to inject
new members into existing classes) and advice (transforming computations
by intercepting events). Conceptually, one can think of a piece of advice
as observing the execution of a base program: when certain patterns of events
occur, that triggers the execution of some extra code in the advice. The
most popular implementation of these ideas is an extension of Java called AspectJ
Apart from AspectJ, there is a rapidly growing number of aspect-oriented
languages emerging from the research community, including Alpha, Aspect#,
Demeter/J, JAsCo, Loom.NET, and many others. Indeed, the paradigm of aspect-orientation
poses several interesting challenges for programming language researchers,
ranging from questions of semantics, through language design, to optimisations
and safety analyses.
Perhaps the most obvious of these challenges is one of efficiency: conceptually,
the paradigm of `observing a base program' is appealing, but when implemented
naively, it would result in unacceptable overheads. A compiler must therefore
shift as much of the event matching process from runtime to compiletime.
Some features of AspectJ do however require runtime checks, and for those
the challenge is to quantify the overheads, and reduce them where possible.
Another open problem is how we can control the effects of aspects, without
limiting their expressive power too much. To what extent can an aspect
observe the implementation details of the base program? If it can observe
implementation details that are otherwise hidden, can we prevent the extra
code from breaking invariants in the base program?
What is the purpose of this tutorial?
The purpose of this tutorial is to introduce the paradigm of aspect-orientation,
and the challenges that it presents, from the point of view of programming
language and compiler researchers. It will then present the AspectBench Compiler
(abc for short), which is a full implementation of the AspectJ
language. It has been designed to allow easy experimentation with new language
features, new analyses and new optimisations.
The frontend of abc is built with Polyglot, an extensible
Java frontend built by Andrew Myers and his students at Cornell. The backend
of abc uses Soot, the Java analysis and optimisation framework
developed by Laurie Hendren and her students at McGill. The tutorial is
thus of independent interest as a study in the use of both Polyglot and
Soot. The abc project is a joint project between the Programming
Tools Group at Oxford, the Sable Research Group at McGill, and BRICS at
the University of Aarhus.
What you will learn in this tutorial?
- basics of Aspect-Oriented Programming using AspectJ using examples
relevant to compiler writers;
- the architecture of a compiler for aspect-oriented languages, including
the design of the abc matcher and weaver;
- how to use the abc workbench to implement your own
language extensions; and
- how to use the abc workbench to implement new analyses
and transformations. that are specific to aspect-oriented languages
Presenter Biography Information
|| Professor Laurie
Hendren, McGill University
Laurie Hendren received the B.Sc.(Honours) and M.Sc degrees in
Computing and Information Science at Queen's University, Kingston,
Canada. She received the Ph.D. degree from Cornell University,
Ithaca, N.Y. Her Ph.D. thesis was in the area of automatic parallelization
of programs with recursive pointer data structures.
Since 1990 she has been a faculty member in the School of Computer
Science at McGill University where she has led the McCAT optimizing/parallelizing
compiler project, and currently leads the Sable project that concentrates
on compiling and optimizing Java. During the 2003-2004 academic year
she visited Professor de Moor at Oxford University, where they started
the joint abc project, the topic of this tutorial.
Oege de Moor, Oxford University
Oege de Moor received an M.Sc. degree from the University of Utrecht,
the Netherlands. He did his doctoral (D.Phil.) work at Oxford,
on a characterisation in category theory of algorithmic paradigms
such as dynamic programming. He has held visiting appointments
at the University of Tokyo, Chalmers University and Microsoft Research
(both Redmond and Cambridge).
Since 1994 he has been a faculty member at Oxford, where he founded
the Algebra of Programming research group, jointly with Richard Bird.
After the publication of a textbook on that subject in 1997, he turned
to the general area of meta-programming, and founded the Programming
Tools Group. Research topics in the group include type systems for
metaprogramming, mechanised support for refactoring, and aspect-orientation.