Hi David: below is some correspondence on visitor composition. Mira was pointing out that that there needs to be communication between vsitors and the traversal (yes, we separate out the traversal). A visitor might not want to go into a subtraversal. I left that out below. Visitor Beans should be able to handle such visitor compositions. -- Karl ===================== Hi Mira: below is a sketch of how to define visitor composition. (visitor-style APPCs) Demeter/Java does something similar without the plug-and-play feature. Does this match with your intuition? -- Karl An interpreter for visitor composition: A composite visitor v consists of subvisitors v1 ... vn. The subvisitors may be composed themselves. Each visitor v has a traversal scope: scope(v) For each visitor a partial call order RC for subvisitors is given. The call order says in which order the visitors should be called. The order is assumed to apply to all classes in the traversal scope. For each visitor a partial return order RR for subvisitors is given. The return order indicates for each visitor from which other visitors it might get input. Call: next_visitor_name(); will return the current result of the visitor with name visitor_name. tso is a topological order of the subvisitors with respect to RC. We assume v is used as follows in an adaptive method: void f() t (v); t is a traversal, for example, determined by a strategy. trav_status is the traversal status. Object do (v.t,v){ call init result = do_it (v.t,v) return result; } Object do_it(v.t,v){ v is composite: for all vi in tso order: ri = do(vi.t,vi) return r1 (or rn?) v is simple: if trav_status = enter a if a is a source of v.t execute start if v has a before a execute it // assume at most one subtraversal if v has a around a execute up to subtraversal if no subtraversal, terminate a if trav_status = exit a if a is a target of v.t execute finish if v has a after a execute it if v has a around a resume after subtraversal (if there was one) if trav_status = enter ->A,b,B if v has a before ->A,b,B execute it if trav_status = exit ->A,b,B if v has a after ->A,b,B execute it