Hi Mira: I plan to send this to the group. How does it look to you? maybe we should discuss. -- Karl ---------------------- Mira and I had a discussion about integrating some of her ideas into Demeter/Java to get them tested in a concrete setting. Suppose we have an adaptive program for DFT of a graph. The cycle check adjustment will turn it into a cycle checker. DFT is implemented by a function dft which we would like to adjust. Adjusting a function cannot be done by a visitor. Instead we define an adjuster class CycleCheck: // adjuster class CycleCheck = Stack. CycleCheck { init (@ s = new Stack(); @) adjustment Adjacency // like an around method (@ //prefix s.push(...); // check for cycle sub.apply(); // do what adjusted method does s.pop(...); @) adjustment Graph (@ // print: cycle check complete sub.apply(); @) } To use the adjuster we write aGraph.dft() with adjusters {CycleCheck}; This adjusts the dft methods for classes Graph and Adjacency. If we are interested in the adjustment object after the call, we can write: CycleCheck c = new CycleCheck(); aGraph.dft() with adjuster objects {c}; // use c The benefits are: we can modify any function, not just traversals since adjusters are classes, they can be structured as graphs fits smoothly into Demeter/Java for traversals, the adjusters are the same as visitors Disadvantages: consistent naming of functions for a group of classes is important for adjustments to work Implementation requires to detect groups of collaborating methods with the same name. Requires analysis of Java code. -- Karl