The new Demeter/Java (in the following called DemeterJ) allows users to use DJ and all the code generation and parsing features of Demeter simultaneously. The advantages of DemeterJ are: 1. You can write a short class dictionary (similar to an XML schema) and you get all the Java source code for getters, setters, and constructors generated. You also get a parser generated. SUN and an industry group wants to put this capability into Java 2. See JSR 31. Demeter is being absorbed into the Java culture. 2. You can use plain Java syntax to write your adaptive code using the basic AP abstractions: ClassGraph, ObjectGraph, Strategy, TraversalGraph, ObjectGraphSlice. No extra syntax to learn. Just learn the package dj: http://www.ccs.neu.edu/home/dougo/doc/ 3. You can use the DemeterJ syntax to better package your methods. The only DemeterJ specific syntax (besides the class dictionary syntax) you need to learn is: ClassName { {{ method1 method2 ... }} } This is the syntax for adding the methods method1, method2, etc. to class ClassName. 4. Question to Doug: what is the easiest way to use the DemeterJ generated visitors PrintVisitor, CopyVisitor, etc. without learning too much Demeter/J syntax. Below is a complete example for counting the inheritance edges in a class graph. If you want to run it, the example is also on the web at: http://www.ccs.neu.edu/research/demeter/course/f00/hw/1/suggested-use-DJ-demjava/ -- Karl File inheritance-edge-counting.beh =========================================== Main { // put into class Main {{ public static ClassGraph buildClassGraph() { ClassGraph cg=new ClassGraph(true,false); // true: include all fields // false: do NOT include all non-void no-argument methods System.out.println("The DJ version is: " + cg.getVersion()); System.out.println("The class graph is" + "============================="); System.out.println(cg); System.out.println("end class graph " + "============================="); return cg; } }} } Utility { // put into Utility {{ static Integer countInhRelsDJ (ObjectGraphSlice subClassSlice) { CountingVisitorDJ count = new CountingVisitorDJ(); Integer result = (Integer) subClassSlice.traverse(count); return result; } }} } CountingVisitorDJ { {{ public void start() { c=0; System.out.println("begin"); } public void before(Vertex o) { c++; System.out.println("before Vertex"); } public void after(Cd_graph o) { System.out.println("after Cd_graph"); } public Object getReturnValue() {return new Integer(c);} }} } class-graph.beh =========================================== Main { // put this code into class Main {{ static public void main(String args[]) throws Exception { Cd_graph graph = Cd_graph.parse(System.in); ClassGraph cg = Main.buildClassGraph(); TraversalGraph tg1 = new TraversalGraph( "from Cd_graph via Alternat to Vertex", cg); ObjectGraphSlice sl = new ObjectGraphSlice(graph,tg1); Integer result = Utility.countInhRelsDJ (sl); System.out.println("result from DJ = " + result); } }} } File class-graph.cd (also serves as input sentence if you delete the first and last two lines) =========================================== import EDU.neu.ccs.demeter.dj.*; // no concept of subpackages in Java // class dictionary Cd_graph = Adj Adj_list. Adj = Vertex Neighbors ".". Neighbors: Construct | Alternat. Construct = "=" Any_vertex_list. Alternat = ":" Vertex "|" Vertex. Any_vertex : Labeled_vertex | Syntax_vertex. Syntax_vertex = String. Labeled_vertex = "<" Ident ">" Vertex. Adj_list: Cd_graph | Empty_cd_graph . Any_vertex_list: Nany_vertex_list | Empty. Nany_vertex_list = Any_vertex Any_vertex_list. Empty = . Empty_cd_graph = . Vertex = Ident. Utility = . // DJ visitor public CountingVisitorDJ = int extends Visitor. Main = .