ATTENTION: This blog has moved to a new location. Please update your bookmarks, browsing habits, and aggregators.
|
|
Sunday, February 23, 2003 |
|
This post (and this weblog) has a new home. Preventing Carpal Tunnel with AOPIt's the weekend, and I have some time to look at (relatively) pure technology. Aspect-oriented software development (a.k.a. aspect-oriented programming or AOP) enables developers to "modularize crosscutting aspects of a system" such as context-dependent logging, tracing, instrumentation, and error checking/handling, among others. Different implementations support "weaving" of aspects into code at compile time or at runtime, but the result can be a significant amount of leverage from a small amount of code. For exception logging and method entry/exit instrumentation alone, I shudder to think about the number of keystrokes it would saved me over my programming lifetime. My initial experiment with AOP (specifically, with AspectJ), a partial refactoring of a text-to-XML transformation tool, has resulted in a substantially smaller and simpler implementation with some additional debugging and profiling functionality as a welcome side-effect. There are a virtually unlimited number of runtime, test-time, and development-time applications for AOP. One particuarly clever runtime application is crazybob's tool to create UML sequence diagrams from a running Java program. There are even refactoring- and maintenance-oriented applications for AOP. For example, it would be interesting to hook up a cut-and-pasted code detector like CPD (based on PMD) to an aspect-oriented system in an effort to pull duplicated blocks of code into aspects. (Maybe this is what FEAT does, which would make sense given that JikesBT provides functionality along the same lines as JavaCC/JJTree provides in the context of PMD.) On the tools/implementations front, AspectJ looks like it will soon have some runtime weaving functionality, a feature that could turn it into an over-all front-runner for AOP in Java. (For starters, I would be happy with a working AspectJ plugin for the version of Eclipse that I use, i.e., 2.1M5, but I'm happy editing with vi and running ajc on the command-line for now.) There are other maturing approaches (e.g., Javassist), but clearly, a single technique if not a single free and open tool - something that people can write and read about and that integrates cleanly with established practices and other tools - is required for widespread digestion and adoption of the technology. AOP is as different from object-oriented programming ("OOP") as OOP was from just plain programming ("JPP"). In fact, AOP is primarily an academic concern for the moment. (AOP is geek-chic enough to have produced multiple nerd brawls... Hold your fire! I'm in both categories.) The questions of how long AOP adoption will take, how far it will go, and in what form are all still very much open. The tools and evangelism necessary to build a bandwagon are just getting started, but even in the hands of a relatively few well-placed software architects, AOP holds the promise of creating simpler software: incontrovertibly a Good Thing for both vendors and customers. 3:43:11 AM |

