Insight: The more fine-grained the predicates, the better the concerns can be separated. traversal function t determined by: S={A->B B->D A->C C->D} if method-name = t and if following S1={A->B B->D} and before D {f1(S1.A, S1.B, S1.D} if following S2={A->C C->D} and before D {f1(S2.A, S2.C, S2.D} if following S2={A->C C->D} and before C {f3(S2.A, S2.C)} if following S2={A->C C->D} and around C {if (cond) {f3(S2.A, S2.C); subtraversal.apply(); xx}} ========== Hi Doug: > what to do, and when to do it > The degree of flexibility that the programming language allows in specifying the second part determines how well behavioral concerns can be separated. > By allowing more precise declaration of the "when to do it" part of a behavioral unit, we remove the tangling that would otherwise occur if the dispatch had be implemented explicitly. This is worth elaborating! In DJ: what to do is described by the methods of an adaptive visitor. when to do it is described by a traversal strategy. We can view the traversal strategy as a set of predicates for all the visitor methods. What kind of tangling would occur if "the dispatch had be implemented explicitly"? Can you provide other examples that support your claim? Maybe an AspectJ example? > The degree of flexibility that the programming language allows in specifying the second part determines how well behavioral concerns can be separated. Is this an important design goal for AOP programming languages? Compare what to do when to do it COOL: method managers exclusion sets RIDL: ? ? DJ: visitor methods traversal strategy AspectJ methods, advice oo method dispatch, point cut designators -- Karl