Is AOP the only way to do it?
Monday, 17. December 2007
Some criticize AOP for its lack of application area. It is difficult to find useful AOP examples except very limited functions such as logging and transaction. Furthermore AOP is a not unique solution for the specific functions and we have done well without AOP.
Surprisingly, I found an assertion saying that “AOP is the only way to do it” from “Debugging and Optimizing Swing Applications” appeared in JavaOne 2007 technical session. If it is true, it is a very good news for AOP evangelists (including me!) who seek really useful AOP applications. Unfortunately, I can say it is not true. The author argues AOP can detect Swing threading violation: Code that affects GUI components should be executed within event-dispatch thread. But A rule SW_SWING_METHODS_INVOKED_IN_SWING_THREAD of Findbugs, static Java code analyzer, also can help check the violation. In fact, static checking is more appropriate than dynamic checking for those violation because the violation stems from location of specific code lines.
I really anticipate the day when someone will find a really useful and unique solution that uses AOP for a specific problem.
