From dougo@ccs.neu.edu Wed Jun 12 02:27:35 1996 To: Karl Lieberherr Cc: dougo@ccs.neu.edu Subject: Re: schedule Karl Lieberherr writes: > please can you do a plan for Demeter/Java and predict when > which features will be available on the net. > "PRE-MEETING HOMEWORK: Each project needs to submit a 1-2 > page summary of what it will be producing in each cluster > area where it is participating and when prototypes will be > available. (Similar to "Innovative Claims" Section of > proposal, but more specific since you're now planning on > doing, rather than proposing, the work.) The description > should emphasize usable "features" rather than technology Demeter/Java is a tool which takes a class dictionary and a set of method specifications and produces a Java source program. A class dictionary is a textual representation of a class graph together with syntactic annotations. There can be three types of method specifications: (1) Ordinary methods. These are Java methods attached to the classes in the class graph which are copied verbatim to the output program. (2) Traversal methods. A traversal method is a succinct subgraph specification of a path to follow through the class graph. The arguments to a traversal method are one or more visitor objects, which have visitor methods that correspond to classes along the path. (3) Visitor methods. A visitor class may have "before" or "after" methods corresponding to other classes in the class graph. For each object being visited in a traversal, the visitor methods on the visitor objects which correspond to the class of that object are called, either immediately before or immediately after the traversal of the object has taken place. The bodies of the visitor methods are copied verbatim to the output program. The traversal specifications are mapped onto the class graph and expanded out into ordinary Java methods, with calls to the appropriate visitor methods in the appropriate places. The final output is a complete Java program, i.e. a list of classes and their parts and methods, which can be compiled and run as normal. The advantage to Demeter/Java is that the structure and behavior are loosely coupled, allowing ease of evolution in one independent of the other. Demeter/Java is different from Demeter/C++ not only in that it produces Java code instead of C++ code, but it also uses a newer technology. A traversal method can be thought of as a form of a propagation pattern, with the visitor methods corresponding to object wrappers; the data members of visitor objects correspond to transportation variables, but with the added benefits of encapsulation and genericity (reusability). A prototype implementing this minimal description will be available in July. It will be written in Demeter/C++ and utilize the state-passing algorithm proposed in [Lieberherr, Palsberg, Patt-Shamir, Pradhan]. By August it will be ported to Demeter/Java; in other words, the compiler will be able to compile itself. By September a small library of utility functions will be available, including functions to parse, print, and compare object trees. Also by September, a prototype implementation of a class graph drawing tool will be available, written in Java using the AWT library. Future research will generalize the language of class dictionaries to be the Unified Modeling Language. It will also allow the behavior to be specified using the context object relation described in [Seiter-Keszenheimer, Lieberherr, Palsberg]. --Doug