Archive for the ‘Spring AOP’ category

Creating a Profiling Aspect with Spring AOP and AspectJ

March 28th, 2010

As I have mentioned previously, there are several utilities that I often find myself reusing when I join a new project.  One of these utilities is the Logging or Tracing Aspect that I have previously discussed while the other is an aspect that facilitates a rudimentary profiling of the application code.

I first got the idea for such a profiling aspect from the Spring Framework user guide which presents a basic implementation in the Spring AOP section.  I subsequently observed a more sophisticated implementation developed by Jerry Kiely, who I occasionally have the pleasure of working with.

In what follows, I will present an implementation of a profiling aspect and explain how this can be utilised using Spring and AspectJ Load Time Weaving.

» Read more: Creating a Profiling Aspect with Spring AOP and AspectJ

Creating a Logging Aspect with Spring AOP and AspectJ

February 16th, 2010

After working in software development for a number of years, one tends to build up a repository of useful code examples and utilities.  I’m certainly no different in this regard and go one step further by maintaining a hosted Subversion repository to keep such code examples safe and sound (and readily accessible).

One such code example that I often turn to is a logging aspect implemented using Spring AOP and AspectJ.  This logging aspect traces method entry and exit which proves very useful if you need to perform root cause analysis in pre-production environments.

In what follows, I’m going to share this code example.  I have also made the logging aspect source code available for download.

I have assumed you have a reasonable grasp of Aspect Orientated Programming concepts and terminologies.
» Read more: Creating a Logging Aspect with Spring AOP and AspectJ