Introduction to Aspect-Oriented Programming
Subject:   Not for shipping code
Date:   2004-01-16 14:42:01
From:   anonymous2
It is proposing to dynamically modify code as it loads, based on method name wildcards for one thing.
How does this scale?
How is it supportable?

I can see it being useful for debugging, like insereting traces or performance probes (this is basically what commercial tools like purify do).

But to create shippable features - never. Design your classes correctly

Full Threads Newest First

Showing messages 1 through 1 of 1.

  • Not for shipping code
    2004-01-17 04:32:30  anonymous2 [View]

    When I first read about the on-line mode in Aspectwerkz I too wasn't keen on the idea. But it does offer one tremendous advantage, you can test AOP on your existing code base by starting your app server with the 'aspectwerkz' command, the rest of your development methodology (build scripts etc.) remain exactly as they are meaning that AOP can be added in a non-obtrusive way.

    The idea of controlling the classloader is not unique to Aspectwerkz, the JBoss AOP implementation also requires control of the classloader (see Bill Burke's article for more info). But Aspectwerkz can run in off-line mode which is my preferred mode. This is similar to AspectJ, you compile your Java classes and then perform the weaving which manipulates the byte code of your java classes.

    Which ever method you chose is up to you, the point of this article wasn't to push Aspectwerkz, I was trying to show how AOP can allow designers and developers to create much cleaner architectures in less time. Cross-cutting concerns usually translates to "repetitive coding", and surely it's better practice to spend your time designing and coding than hand-coding thousands of lines of logging code.

    When I wrote the first draft of this article I sent a copy to Jonas to have a read to make sure he was happy with how it had been written. When he saw the first draft he commented that AOP shouldn't be seen as a magical process that works behind the scenes. The fact is that AOP can be used to vastly simplify a system's design and reduce development time, perfectly complementing OO rather than providing a mechanism to patch a poor OO design.