Advanced AspectJ Part II : Inter-type declaration

In this article, we discuss about another ApectJ advanced feature: inter-type declaration (ITD), or more commonly called member introduction.

In essence, this feature lets you “inject” new fields or methods into an existing class using an aspect.

With ITD you can for example achieve virtual multiple inheritance or mixin. It is extremely powerfull but also very bug-prone because it somehow breaks basic Java encapsulation rules.

Read more of this post