I see that Sam Gentile and Drew Marsh have been writing about CLAW. So I felt that it’s my duty to tell folks what the current status of that project is.
Currently, CLAW is in limbo; I haven’t really touched that codebase since about October or so. The versions that I have been showing at different conferences are an early prototype that I wrote back in about March of last year. I have a different codebase that included a formal definition of an aspect weaving language that I wrote using ANTLR. Unfortunately, the new codebase is only partially operational and doesn’t have the functionality of the original prototype.
Why haven’t I continued working on CLAW? Since working on the project, I’ve had rather mixed feelings about AOP as a technology; I believe that AOP, as it stands today, is too complicated to use as a general-purpose development methodology.
The main issue that I have with AOP is that it is not possible to discern the functionality of code simply by looking at the source code. AOP allows the deliberate introduction of side-effects into a codebase. The canonical (and trivial) examples of AOP are always side-effect free: logging and tracing aspects being the ones most often seen.
Unfortunately, you run into problems the minute you have aspects that contain side-effects. Perhaps the simplest aspect with side-effects is a security aspect. It grants / denies access to a piece of code based on some security policy. While this in and of itself is not necessarily bad (depending on your point of view), things become far more complicated when you have multiple aspects at a single join point. Think about cases where you have both security policy code and business rules enforcement code woven into a single join point. You now have a case where the order in which the aspects are applied become important (among other things).
Now consider happens when someone needs to fix a bug. Where is that bug? Is it in the method? Is it in the security policy aspect? Is it in the business rules aspect(s)? What if the bug is a result of the interaction of those aspects? How do you even know the aspects are there?
Some of these problems can be solved by a good IDE. The now-defunct Intentional Programming project at Microsoft Research produced a phenomenal IDE that can already provide aspect visualization in source code (check out the video at Lutz’s site). The AspectJ folks did a great job of integrating aspect visualization into existing tools like Eclipse and Emacs.
However, I don’t have the resources to build an IDE. Anyone who is going to try and push AOP into mainstream development had better have a lot of resources to back up that project. It’s really a job for a Microsoft or an IBM (or a really rich Charles Simonyi who can afford to fund his own AOP company). It doesn’t seem like Microsoft is particularly interested in AOP, especially since they canned the IP project.
Another related problem is adding new functionality. How do you add it? In an aspect? In your codebase? Some combination thereof? I feel that providing devs with more options in these cases are going to lead to some really nasty bugs in large codebases.
I hope you don’t get the impression that I believe that this technology is not without merit. It’s extremely powerful and useful, but not as a general-purpose technique. I believe that there are two really interesting applications of AOP:
- Security policy enforcement / monitoring
- Diagnostic probes
You could argue that 1) is a special case of 2), but I digress. There are already companies that I know of working in 1), and 2) cannot be far behind.
Diagnostic probes are particularly interesting. I believe that there are a large class of bugs caused by inappropriate use of API’s. Designers of API’s could build diagnostic probes (which are cousins of unit tests) that could be used to validate that applications are calling API’s correctly. Here’s a few trivial examples that I showed using CLAW:
- Tracking whether ADO.NET connections were released, and identifying the point in your source where you opened the connection if it wasn’t released
- Enforcing quotas on resources. One particularly interesting one was a scalability policy based on measuring how long it took for transactions to commit.
I think that 2) is fertile ground for further development, but I have moved on to other areas. If anyone is interested in collaborating in these areas, I would consider doing some consulting work to help get you up to speed. I really like this technology, but I just don’t have the time and resources to develop it …
8 archived reader comments
Sam Gentile (2003-02-11)
Thank you John for your well thought out and clear response.
Andrew Stopford (2003-02-12)
Just a thought but how about making the project opensource John?
John Lam (2003-02-12)
I’m thinking about it. Unfortunately, I just don’t have the cycles to clean up the code and write the docs so that someone can actually start building stuff on top of it. Sam can vouch for this - installing it and getting it running is really nasty. But it is on the list of things that I’d like to do.
Dave Lee (2003-02-12)
Thats what I was thinking, if you can’t find the code a new home, release it to the wild. If you do decide on opensourcing the code, and don’t plan on being the maintainer, you could “audition” some hopefuls by getting them to help clean the code and write the docs.
John Lam (2003-02-13)
Thanks for the suggestion, Dave. I’ll think about doing this once I get some cycles. March is shaping up to be a real busy month …
Zohar Melamed (2003-03-05)
With test driven design and usage of MockObjects (perhaps provided by the API designers) you can flush out incorrect API usage at unit test time.
Minwell Huang (2003-07-19)
I am interested in applying AOP to security. John, would you provide more information for me to find those companies in this area? I just want to find more references. By now,I just know of “New Aspects of Security”: http://www.newaspects.com/
Thanks
Sean Hederman (2003-10-27)
I’ve completed an pull-aspect engine using Proxy, but have not been able to use it due to the fact that I can only access MarshalByRef objects with it. I need to update my engine to handle any object type I require, and thus I think I need to hook into Profiler like you did. However, I’ve had a look and found it daunting. Have you got any docs/examples which I can use to get going?