Simplifying Enterprise Applications with Spring 2.0 and AspectJ

Adrian Colyer

An article I wrote for the InfoQ site has just gone live: Simplifying Enterprise Applications With Spring 2.0 and AspectJ.

I've heard a number of people saying that "AOP is too hard", or "AOP makes things too complex". In a way this article was written as a rebuttal of those views (hence the title, "Simplifying Enterprise Application Development"). I mean, the whole point of AOP is that you take software that was getting complex and tangled up, and you simplify the implementation by giving each module a single responsiblity again by introducing aspects. And then of course for some requirements that are naturally expressed in a crosscutting way, it's much simpler and easier just to implement them with an aspect in the first place. The article shows how this process works, and lays out an adoption roadmap that counters the "AOP is too hard" argument – at each step along the way you can get a lot of value without having to become an AOP guru.

It's also a good introduction to the facilities offered by Spring AOP in the Spring 2.0 release. Check it out and see what you think…

Similar Posts

Share this Post
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • DZone
  • LinkedIn
  • Slashdot
  • Technorati
  • TwitThis
 

2 responses


  1. The article is very well written but the problem is the lack of source code. Is there any possibility of getting the code for the refactored petclinic.


  2. Hi Adrian

    Thanks for the very interesting article!

    Was just trying the LostUpdateDetector aspect. I had a problem with it, because I declared the @Transactional annotations on the interface instead of class. Therefore the readOnlyTransaction Pointcut did not work, because SystemArchitecture.businessService() is an execution join point and it can't find the @Transactional annotations. I had to switch to call join points to make it work. Wouldn't it be better do declare it both on execution() or call() ?

    pointcut readOnlyTransaction(Transactional txAnn) :
    (call(* com.trivadis.eurojourney.application..*.*(..)) ||
    execution(* com.trivadis.eurojourney.application..*.*(..))) &&
    @annotation(txAnn) && if(txAnn.readOnly()) ;

    Are there any side-effects doing that ?

    Thanks
    Guido

Leave a Reply