Hi Mira: I did the Batory paper example with our notation. What I discovered is a need to modify a group of classes permanently at compile time (during a compile-time traversal) and not only for the duration of a traversal at run-time. How can the two mechanisms coexist? Below we don't need "when-visiting". And in this case we can make a permanent variation. Only visitors without "when-visiting" can be used for permanent changes. This looks good since we want to integrate with Batory's techniques anyway and this example shows how we can express his layered systems in our model. Inheritance does single class variation permanently. Batory does multiple class variation at permanently. We do multiple class-variation both permanently and during the life-time of certain traversals at run-time. Inheritance and Batory express variation by adding and overriding methods and we, in addition, express variation by executing additional code during a traversal at run-time. -- Karl From Implementing Layered Designs with Mixin Layers by Batory et al. http://www.cs.utexas.edu/users/schwartz/pub.htm BINTREE_Visitor(Strategy s) { during s { at Node { // Node parent_link; Node left_link; Node right_link; // local methods } at Container { Node header; void insert(EleType el) { ... } void erase (Node node) { ... } boolean find (EleType el) { ... } } } } TIMESTAMP_Visitor(Strategy s) { during s { at Node { Time creation_time; Time update_time; boolean more_recent (Time t) { ... } } at Container { Time update_time; boolean find_newer(EleType el, Time t) { ... } void insert (EleType el) { ... } // other time-related methods } } SIZEOF_Visitor (Strategy s) { during s { at Container { int count; init (@ count = 0; @) void insert (EleType el) {next.insert(el); count++;} void erase (Node node) {next.erase(el); count--;} int size () {return count; } } } } Node = EleType. Container =
Node. strategy: From Container to Node. // watch the parent link Container { //not useful, want to use behavior outside f void f() to Node {SIZEOF_Visitor uses TIMESTAMP_Visitor uses BINTREE_Visitor} } // want a permanent change Container { permanent to Node {SIZEOF_Visitor uses TIMESTAMP_Visitor uses BINTREE_Visitor} }