Hi Binoy: The discussion with Mira is archived at: /proj/adaptive/www/related-work/Rondo Please can you add a test case to the test suite which implements the programming style which Mira outlined yesterday and which Doug also proposed for the Demeter/Java version of the program. I agree that it is better than my style of nesting the visitors. Please start with the program in: /proj/adaptive/www/sources/DemeterJava/examples/j-check-capacity-stack-new2 and change the cd from // solving the capacity checking problem from hw 2 // without modifying the host // visitor has own stack to keep track of initial value // class dictionary ... CheckingVisitor = InitialVisitor int. SummingVisitor = int. InitialVisitor = // takes care of computing initial value int // result for communication // with checking visitor Stack SummingVisitor. to SummingVisitor : InitialVisitor *common* int. InitialVisitor = CheckingVisitor *common* int Stack. CheckingVisitor = int. Instead of using before and after, do everything with around methods. Mira's example is below. This should not take more than an hour. By tomorrow please. -- Karl Example 2: Container -------------------- For the container example the summing adjuster above can be reused. The strategy now is S1 = from Container to Weight; adjuster CHECK(strategy s) adjustment SummingEntry { (@ int total_sum; @) init (@ total_sum = 0; @) return (@ total_sum @) } adjustment Sum(int total_sum) { change target(s) (@ total_sum += this.value; super(); @)} adjustment Initial modifies Summing { (@ int initial; Stack stack; @) change source(s) (@ stack.push(this.total_sum); super(); initial = (Integer) stack.pop(); @) } adjustment Checking modifies Initial { (@ int violations;@) change source(s) (@ System.out.println(" start new container "); super(); integer initial = this.initial; int cap = this.get_capacity().get_i().intValue(); int diff = total_sum.intValue() - initial.intValue(); if (diff > cap) { violations = new Integer(violations.intValue() + 1); // this.set_violations(new Integer(violations.intValue() + 1)); System.out.println(" total weight " + diff + " but limit is = " + cap + " OVER CAPACITY "); }; System.out.println(" end container "); } Container c = new Container{CHECK during S1}. c.checking().