We use Spring AOP extensively in all our current projects. I should perhaps add that this is about coarse-grained AOP, usually applied against business objects, rather than the fine-grained pervasive AOP that AspectJ invites you to write. In that, it is evolutionary rather than revolutionary.Originally posted by karthik Guru:
Has anyone used AspectJ successfully in custom projects?. By 'use' I mean has anyone put AOP to considerable use in their projects?
In Spring's case, if you advice interfaces, you see a Java dynamic proxy and the associated Spring invocation handler. It's actually quite straightforward when you step through it with a debugger. I've not used cgilib-based (class) advice in anger.How does the code show up while debugging?
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Originally posted by Peter den Haan:
We have an architecture whereby each module exports one object. In a few cases, we need to export more than one business interface implemented by more than one object, and we use introduction advice to merge them together.
It's not a compelling AOP use case, but it was pretty convenient regardless. The basic problem was that we had an object FooImpl implementing Foo, an object BarImpl implementing Bar, and needed to expose both Foo and Bar as a single object. Without AOP, you might write something likeWith AOP, we just introduced interface Bar implemented by BarImpl into Foo. The result is a Java proxy implementing both Foo and Bar, and delegating calls to FooImpl and BarImpl as appropriate.Originally posted by karthik Guru:
Could you expand on this more? [...]
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd