next up previous
Next: Congruent arguments Up: Late Binding of Advice Previous: Late Binding of Advice

Advice grouping

In order to be able to talk about late binding of advice it is necessary to introduce some kind of device that allows us to establish a group of related advice declarations. It is not reasonable to assume that all advice declarations which happen to be enabled at the same point are logically related such that it makes sense to choose one and ignore all others. We therefore need to control advice grouping explicitly. We discuss how to do this in the next sections; for now we just assume that it has been done. After having determined that an advice group as such is enabled, we choose exactly one most specific advice and invoke it, ignoring all the others in the group (they are being overridden). Advice declarations outside the group are being processed independently. In Listing IncrTracking.java we would choose to invoke the second advice for p being an instance of Point or a subclass thereof, and we would invoke the first advice for instances of FigureElement or a subclass thereof except Point and its subclasses.

Finally, invoking the most specific advice and ignoring all others in the group is just one possible semantics for late binding of advice. With reference to the CLOS [5,19] method combination framework we could also envision composing an effective advice out of several applicable advice declarations in the group.


next up previous
Next: Congruent arguments Up: Late Binding of Advice Previous: Late Binding of Advice
David H. Lorenz 2003-01-15