Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Static crosscutting

I currently need to do something very similar to the example at
http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/aspectj-home/doc/progguide/examples-production.html#d0e2676
(adding property change support to existing classes). I assume such an
aspect for adding property change support to a class could be applied to
several classes at once, or would I need to write one aspect per class
(not feasable)?

Is there a good reason why the example uses a caller rather than a 'set'
pointcut (would seem more suitable here)?

Another issue is how to deal with collection classes. Is it possible to
not only add advice to method calls such as
someObject.setChildren(someList), but also to
someObject.getChildren().add(something)?

The problem here is that the 'children' field is a standard ArrayList.
One obvious solution would be to replace it with a custom list class
that can be modified, but perhaps there is a more elegant way to detect
changes to collections with AspectJ.

--
Eric Jain



Back to the top