Using and Reusing Aspects in AspectJ

Stefan Hanenberg

2001 · 20 citations · 2 references

Concepts

Abstract

One of the major benefits of Object-Oriented Programming (OOP) is, that it supports inheritance as a mechanism for code reuse and incremental modification. Wellestablished object-oriented technologies like white-box frameworks make exhaustively use of and intensively rely on inheritance. Aspect-Oriented Programming (AOP) is a new technology, which supports another extension mechanism whose intension is to enable a better separation of concerns. General-purpose aspect languages (GPAL) like AspectJ are build upon object-oriented programming languages, and in that way it is possible to combine both extension mechanisms. This paper shows that both mechanisms are in contradiction to each other. The result is, that the advantages of inheritance are no longer available. Furthermore, incremental modifications and code reuse are not directly supported for the new language features of AspectJ. So, the application of techniques like redefining aspect-specific behavior is not possible. This paper proposes some rules of thumb, which allow to modify aspects incrementally and reuse aspect-specific code in AspectJ. Moreover, this paper shows how in that way the cooperation of inheritance and aspectual modification is achieved. 1

References

2