2005/05/01

Thoughts on AOP

Not that I've used it or anything.

I've read up in the C2 wiki and looked at various examples. I believe I understand the theory relatively well, and beneath all the new terminology AOP appears to do two things:

1. Adds a transparent event model for access/modification of methods, variables & objects. I believe that Ruby can do this without the after-the-fact style of bytecode modification, and AOP applies this to 5GL's (or whatever you want to call Java, C# etc.)

2. As per the promotional material, provides a new way of separating cross-cutting concerns. Of course, multiple inheritance could do this :-) As has LISP and it's progeny. I imagine the relevant newsgroups are overflowing with scorn at the world of Java for having re-invented yet another feature LISP has had since the Epoch and before.

Anyway, my point is, that AOP is clearly accomplishing two different things here. (Maybe these concerns should be separated :-) The first is obviously valuable, and something that pure Java misses. The second is also valuable, but as per Koppen and Stoertzer, is ideally accomplished without resorting to meta-programming and code weaving, which are cool techniques, but render affected functions unfaithful to the source code from which they were compiled, which is never cool.

Right now, AOP is an add-on to Java, but I'd like it to become more fully integrated with the language before using it heavily. PCDiff is very cool and the 2nd plugin I'd install (after ajdt) if/when I start doing AOP.

No comments: