Chapter 8. Inter-Type Declarations

Whereas advice is a declaration that an aspect will execute certain behavior in the program control flow at designated join points, inter-type declarations are a statement that an aspect takes complete responsibility for certain capabilities on behalf of other types (the “targets” of the inter-type declarations). Inter-type declarations are useful when you need one or more types in a program to acquire a capability (such as the ability to be printed) for some common purpose.

Inter-type declarations can be used to provide definitions of fields, methods, and constructors on behalf of other types. They can also be used to implement interfaces and to declare super-types. Section 8.1 shows you how to use inter-type ...

Get Eclipse AspectJ: Aspect-Oriented Programming with AspectJ and the Eclipse AspectJ Development Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.