Downloading DJ

DJ is currently only available as part of Demeter/Java. Follow the setup instructions for that.

To use DJ you will need to put the dj.jar and aplib.jar files on your CLASSPATH, in addition to the general Demeter support classes in rtlib.jar.

For Northeastern students, these files are in the /proj/demsys/demjava directory, so you can set this up with this command in your ~/.software file:

  CLASSPATH=/proj/demsys/demjava/dj.jar:/proj/demsys/demjava/aplib.jar:/proj/demsys/demjava/rtlib.jar

The provided classes are


Using DJ

DJ provides methods such as
  Object traverse(Object obj, Strategy s, Visitor v)
on the class ClassGraph. This is used to traverse an object structure in accordance with a given Strategy. See the strategies section of the Demeter/Java User Manual for the definition and syntax of strategies.

A Visitor object is passed to traverse(). As the object obj is being traversed, methods of the visitor will be invoked with parts or sub-parts of obj as arguments. The toString() methods of Strategy and TraversalGraph will return a readable representation which may be useful to analyse.

All visitors and classes and their parts must be made public. Non-public visitor methods will produce an error. Non-public object parts will not be traversed.

Here are some examples of a program using DJ. These may be found at /proj/asl/jayantha/DJ/examples/