Spring Source - Developing Aspects with AOP;

by John Turner

Posted on November 11, 2009

I have previously posted some comments about my experience attending the Core Spring training. Recently I noticed that Spring Source provided a free online training titled Developing Aspects with AOP and decided I’d take a look.

The training is in the form of a Quick Time movie which can be downloaded from the Spring Source community website. One of the first things that is pointed out is that the training is based on material from the 4-day Core Spring course and having attended the course I can say that it is indicative of the presentation and content on the course. If you are considering attending any of the Spring Source courses I would recommend viewing this online training to give you some idea of what to expect.

The ‘Developing Aspects with AOP’ online training takes just over 50 minutes to watch and starts by providing a background to AOP, the problems it solves and the advantages of using AOP to solve these problems. Code tangling and scattering are discussed along with good examples of each using sample code.

The training goes on to introduce AspectJ and Spring AOP and introduces some key concepts such as Join Points, Pointcuts, Aspects and Advice. A simple scenario is outlined and expanded upon to demonstrate applying Spring AOP to log method execution. Some examples of using the AspectJ pointcut expression language are also provided.

Examples of accessing context information from within an Advice are worked through before describing the types of Advice that can be applied with Spring AOP. Finally the training demonstrates the difference of applying Spring AOP using annotations or XML.

If you are interested in Spring and Spring AOP, this material is well worth 50 minutes of your time. I think it complements the reference documentation and for someone new to AOP I would recommend viewing the online training prior to reviewing the reference documentation. The reason I say this is that the reference documentation goes into more depth in certain areas, particularly the subtle nuances of Spring’s proxy based AOP.