Advanced AspectJ part V : integration with Spring

In this article we’ll see how to integrate your own aspects with Spring.

First we focus on load-time weaving using Spring’s dedicated AspectJ agents. Then we’ll see how to let Spring inject beans into your aspects

Read more of this post


Advanced AspectJ part IV : declaring aspects precedence

Today we discuss about aspects precedence e.g. the order in which several aspects are processed at the same join point.

If you’re a heavy user of AspectJ you can sometimes end up with having more than one aspects for the same join point. In such case it could be interesting to know which aspect kicks in first and which one kicks in last. This order is called aspect precedence.

Read more of this post

Advanced AspectJ part III : non-kinded pointcuts

Today we will focus on non-kinded poincuts of AspectJ.

Unlike kinded pointcuts (method execution, field access, object initialization …), non-kinded pointcuts select join point on some criteria other than the join point signature (no kind). For example it is possible to select join points inside the source code(lexical structure) of a Java class or method.

Read more of this post

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

Advanced AspectJ Part I : Instanciation model

In this serie of articles we’ll talk about advanced features in AspectJ. This will exclude for sure popular AspectJ construct like method execution or within join points.

This first article deals with the instanciation model of AspectJ

As support for our talk, we’ll create a logger injection using annotation and AspectJ.

Read more of this post