Coding Issues in AspectJ

AOP [1] has been proposed as a way to write programs that elegantly implement crosscutting concerns. This paper presents initial results of an exploration into whether this is true for AspectJ [2]. During this this exploration we have written several small and medium scale systems using AspectJ. Writing elegant code requires good implementation structure. This paper presents some of the more interesting coding style decisions we encountered. We present different approaches to implementing several crosscutting concerns and comment on the relative strengths and weaknesses of each approach. The purpose of the paper is to share our practical experience of using an AOP language to give workshop participants a sense of what it is like to use AOP and in particular the design issues one faces when trying to write elegant code with AspectJ. We offer this information to support a well-grounded discussion of the strengths and weaknesses of AOP, and the challenges facing AOP researchers. The paper assumes that the reader can read Java programs, and has basic familiarity with AOP.