O'Reilly logo

Eclipse AspectJ: Aspect-Oriented Programming with AspectJ and the Eclipse AspectJ Development Tools by Matthew Webster, George Harley, Andy Clement, Adrian Colyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Aspects

You have seen lots of examples of aspects so far in this book, and so you already know quite a lot about them. This chapter fills in the missing pieces that we haven’t touched on so far: aspect instantiation and lifecycle, abstract aspects and aspect inheritance, inner aspects, and privileged aspects. Before we get into that, the next section presents a short overview of the basic form of an aspect declaration.

Aspect Definition and Initialization

An aspect declaration looks very much like a class declaration, with the keyword class replaced by the keyword aspect. A bare-bones aspect declaration looks like this:

aspect AnAspect {
}

AJDT uses the icon to represent an aspect. Aspects may be declared either with default visibility ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required