Aspect interface study for the display visitor generator in DemeterJ: We need a traversal that goes to all class definitions. Aspect interface for: /proj/adaptive/www/software/src/generate/gendisplayvis.beh Why is this .beh file an aspect? Definition: An aspect is a module whose ad-hoc implementation cuts across multiple components. Method generateDisplayVisitor. Its ad-hoc implementation would cut across dozens of classes. (Check DemeterJ generated code) Interface Class Graph: Program = List(ClassDef). ClassDef = ClassName List(Part). Part = [PartName] ClassName . PartName = Ident. ClassName = Ident. visitor signature: before Program after Program before Classdef before Part strategies: from Program to {ClassDef, Part} Important note: from Program to {Part} is sufficient because the interface class graph guarantees that "from Program to Part" has "from Program to ClassDef" as a prefix. (G,s2) is a prefix of (G,s1) if for every path p in the path set of (G,s1) there is a prefix in the path set of (G,s2). What is the complexity of the prefix decision problem? Given G, s1 and s2: Is (G,s2) a prefix of (G,s1)? What is the complexity of the AllPrefix problem: Given G and s1, list all strategies s2 so that (G,s2) a prefix of (G,s1). composition example: Replace ClassDef = ClassName List(Part). by ClassDef = Classname ClassParts. ClassParts : KindA | KindB common List(Part). KindA = "a". KindB = "b". visitor signature: before Classdef if s1 succeeds ... if s2 succeeds ... strategies s1 = from ClassDef to KindA s2 = from ClassDef to KindB Instantiation: { Program, ClassDef } { traversal allParts(PartVisitor v) { to { Part, RepeatedPart }; } What is the class graph? See generate.cd. Mapping: ================= gentracevis.beh is a little simpler