QCon 2007 Notes: Spring Aspects

Rod Johnson, AOP in the Enterprise

  • AOP makes things simpler because it makes the implementation look more like the requirement
  • We can define the abstraction in the implementation:
@Aspect
public class SystemArchitecture {
    @Pointcut("within(a.b.c.dao..*)")
    public void inDataAccessLayer() {}
  • We can then use AspectJ to enforce architectural rules, or warn when they are broken:
declare warning
: callToWebLayer() && !isInWebLayer()
: "There should be no calls into the web layer from outside"
  • See the slides for other examples
  • RJ: “Currently as customers we have all ten of the world’s largest banks”
    • And at least three of them are using AspectJ, even when AspectJ doesn’t really have a commercial backer, which is very interesting

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply