Question

I want to use an AOP framework, but I have two constraints.

Any framework that I choose

  1. Must be fairly independent. I plan to use this in a legacy code base, and hence cannot upgrade prospective dependencies like commons-logging-XXX.jar to commons-logging-newest.jar.

  2. Must be fairly well documented, should not be too complex to understand and integrate.

Was it helpful?

Solution

AspectJ as far as I can tell is just a compiler and imposes no dependencies on compiled programs other than including the AspectJ runtime jar.

It is also actively maintained, part of the Eclipse project and has a nice development environment (AJDT, a plugin to Eclipse).

OTHER TIPS

I like Spring + AspectJ. You can do all of your pointcut definitions in xml if you like, and you don't need to change a line of code on your legacy stuff. If you already know spring and AOP concepts, there's not much to learn.

Okay, this one doesn't fit all your requirements, but I think, it's worth a look: http://dynamicaspects.sourceforge.net/

Positives

  • No dependencies except needs java 1.5 due to using the JavaAgent
  • No XML markup needed and just works with POJO classes
  • Tried myself and found it very easy to use (not very complex)

Negatives

  • No more activly maintained afaik
  • Poor documentation
  • You cannot do everything a full fledged AOP framework allows you to do

I tested it out some time ago and was pretty impressed but found some glitches which I don't remember right now. Though you might give it a try.

Greetz, GHad

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top