Announcement: Aquarium v0.1.0 - An Aspect-Oriented Programming Toolkit for Ruby

Posted by Dean Wampler Thu, 23 Aug 2007 22:18:00 GMT

I am pleased to announce the first release of Aquarium, an Aspect-Oriented Programming toolkit for Ruby.

I created Aquarium to address a few goals that aren’t adequately addressed by other AOP toolkits for Ruby. Most of these goals reflect the issues you encounter when using sophisticated aspects in large systems.

First, the most important feature of any AOP toolkit is the “pointcut” language it provides, which is how you succinctly specify the “join points” across a system where behavior changes are required to support the “cross-cutting concern” that the aspect implements.

Most people assume that Ruby doesn’t need an AOP framework because its built-in metaprogramming facilities make method interception and wrapping easy. This is the “advising” part of an AOP toolkit. However, the real value of AOP is the modularity capabilities provided by the pointcut language. One goal for Aquarium is to match and even exceed the power of the AspectJ pointcut language. I also hope to make it as user-friendly as possible.

Next, Aquarium seeks to handle the issues that arise when multiple advices are applied to a single join point, including precedence control.

Another goal is the ability to add and remove advice dynamically. For example, you might want to insert troubleshooting advice in a running system, then remove it later when the issue is resolved. The first release already implements this feature, with some limitations.

Finally (for now), I want to use Aquarium as a vehicle for experimenting with DSL implementation ideas. For several years, there has been discussion (started by Ivar Jacobson) of the idea that aspects share an affinity with Use Cases (or User Stories), because both concepts cross-cut the application domain object boundaries, in one sense or another. So, if I define a DSL that directly represents a user story, can I map it quickly and efficiently to the implementation objects using aspects? We’ll see.

There is extensive documentation at the Aquarium site. Please give it a try and let me know what you think!

Posted in , ,  | 3 comments