Aspect-oriented Refactoring of Java Programs

Research output: Chapter in Book/Report/Conference proceedingChapter


Aspect-Oriented Programming (AOP) is an emerging programming paradigm providing novel constructs to improve the overall modularity of a software system. The primary contribution of AOP is the modularization of crosscutting concerns (CCCs), which give rise to the negative symptoms of scattering and tangling, which make a system hard to reason with, maintain and evolve. The Java language and platform played a central role in the early years of research and development of AOP. Most aspect-oriented programming languages (AOPLs) proposed throughout the years are backwards compatible extensions to existing languages and the majority of such extensions use Java as the base language (Brichau & Haupt, 2005). Some of the proposed Java extensions were proof-of-concept projects whose development was later discontinued, but a few of them kept pace with the subsequent development of their base language and evolved into robust, full-fledged industrial languages in their own right (AspectJ, OT/J).Refactoring (Fowler, 1999) is the task of modifying the internal structure of a software system without changing its externally observable behaviour. The availability of AOPLs that are backwards compatible extensions to Java opens the way to aspectize Java systems, i.e., refactor a Java system to turn it into an aspect-oriented version of that system. This is the task of aspect-oriented refactoring (Monteiro & Fernandes, 2006a, Laddad, 2003).Aspectizing systems with symptoms of crosscutting concerns (CCCs) promises to bring several benefits, namely improved modularity and evolvability and the removal of negative symptoms associated to the presence of CCCs. Availability of robust, up-to-date, aspect-oriented extensions to Java makes it worthwhile to reengineer existing Java systems this way.The purpose of this chapter is twofold. First, it provides a short overview of aspect-oriented programming in general. Second, it provides a survey of the current state-of-the-art in aspect-oriented refactoring. The rest of the chapter is organized as follows. Section 2 introduces the topic of crosscutting concerns as a fundamental problem in modern software. Section 3 introduces the topic of refactoring and establishes and clarifies the relation between CCCs and refactoring. Section 4 provides an introduction to AOP, using AspectJ as its typical representative, and discusses the fragile pointcut problem, which is possibly the primary technical problem in aspect-oriented systems. Section 5 surveys the various research fronts regarding aspect-oriented refactoring. Section 6 concludes the chapter with a summary.
Original languageUnknown
Title of host publicationJava in Academia and Research
EditorsKe Cai
Place of Publicationonline
ISBN (Print)978-0980733082
Publication statusPublished - 1 Jan 2011

Cite this