Hi Johan: Your traversal implementation description in http://www.ccs.neu.edu/research/demeter/design-decisions/TAO/jan11 Documentation.ps gives a good introduction to TAO. It works, however, only for the most common cases and is not general because it does not construct the traversal graph. For Demeter/J (Java with traversal support) we will use a general solution using the AP library. In Demeter/J we have Strategy-objects, TraversalGraph-objects and static methods long_get, long_collect and traverse of class Traversal. The current class dictionary is kept in a static variable. The methods long_get, long_collect and traverse take either a Strategy-object or a TraversalGraph-object as input. TraversalGraph-objects are useful to have around to deal with evolution of the class graph. To do the run-time traversals Demeter/J uses reflection. http://java.sun.com/docs/books/tutorial/reflect/object/invoke.html From the TraversalGraph-object we know which parts to traverse. We assume that a traversable part x has a public get_x(). Using reflection, we retrieve the right Method-object and invoke it using invoke. -- Karl Summary of classes for package TraversalSupport: class Traversal static Object long_get(Object o, Strategy s); static Object long_get(Object o, TraversalGraph t); static Iteration long_collect(Object o, Strategy s); static Iteration long_collect(Object o, TraversalGraph t); static Object traverse(Object o, Strategy s, Visitor v[]); static Object traverse(Object o, TraversalGraph t, Visitor v[]); class ClassGraph ClassGraph(File f[]); See: http://www.ccs.neu.edu/home/telliott/proposal.html class Strategy class StrategyEdge class StrategyEdge_List class Source class Target etc. ======== cd Strategy = List(StrategyEdge) . StrategyEdge = Source Target [Bypass]. Bypass = ClassName. Source = ClassName. Target = ClassName. ClassName = Ident. LabelName = Ident. class TraversalGraph TraversalGraph(ClassGraph cd, Strategy s); TraversalGraph Intersection(traversalGraph t1, TraversalGraph t2); class Visitor // superclass of all visitors Phase 1: Phase 1: ======== class Traversal static Object long_get(Object o, Strategy s); class ClassGraph ClassGraph(File f[]); See: http://www.ccs.neu.edu/home/telliott/proposal.html class Strategy class StrategyEdge class StrategyEdge_List class Source class Target etc. ======== cd Strategy = List(StrategyEdge). StrategyEdge = Source Target. Source = ClassName. Target = ClassName. ClassName = Ident. ======== class TraversalGraph TraversalGraph(ClassGraph cd, Strategy s);