3 ms·
AspectJ (http://www.eclipse.org/aspectj/ http://www.eclipse.org/aspectj/) is IMO a pretty good implementation. I've used it recently for an Android application.
by arebop 17y ago
AspectJ (http://www.eclipse.org/aspectj/ http://www.eclipse.org/aspectj/) is IMO a pretty good implementation. I've used it recently for an Android application. Gregor Kiczales (http://www.cs.ubc.ca/~gregor/ http://www.cs.ubc.ca/~gregor/) used it for a conference tutorial I attended a few years ago, so that's a sort of implicit seal of approval from him as well. On the other hand, he did point out that it couldn't handle all the examples he showed in his paper (which were implemented in Lisp).
I was not impressed by the various AOP libraries for .NET when I looked at them several years ago. They imposed so many requirements on my code that it seemed to defeat much of the benefit of AOP's beautifully elegant combination of joinpoints and advice.
A problem with AspectJ and I suspect with most implementations is that weaving and optimization can conflict. For example, if a method invocation is inlined by a compiler, the compiler needs to know about applicable advice. This complicates pointcuts and it means that AspectJ can't necessarily be used like dtrace to instrument code you didn't write.
- lucifer 17y agoDon't think the optimization point holds. Optimization for Java really kicks in at runtime and the JVM is fully in loop regarding byte code modifications.