Message
In the middleware space, I would certainly
agree that a library of pointcuts is probably just as important as a
library of fully defined aspects. When interfacing with an established
system, it would be very difficult for a new developer to understand
the control flow required to intercept a JMS message, for example. In
fact, for library writers in general, it would be an interesting
experiment to provide a series of pointcuts for use with AOP instead of
built in complex interceptor stacks (as Tomcat and Axis have done).
But I think that one of the keys points with AspectJ is that even if
you extend an abstract aspect and reuse it's pointcuts, your advice is
still defined relative to the pointcut, not independent of it. If we
assume that most advice is tightly coupled with the pointcut or type of
pointcut it depends on, then the separation of these concepts becomes
more of a burden than a benefit.
Agreed. I was just pointing out the fact that a case can be made for
both approaches: advice and pointcuts tightly coupled or clearly
separated and reusable independently of each other.