Fact Sheet

Demeter Research Group, Northeastern University, College of Computer Science, Boston

What does the product do? DJ is a tool which allows you to
write generic Java programs that
are easy to evolve and reuse. DJ is easy to learn and use by
Java Programmers and allows them to use high-level actions like
traverse, fetch, gather, find, add, delete, etc.
DJ builds on the observation pioneered by the Demeter
project that navigation through object structures is ubiquitous
and therefore warrants a special purpose language for navigation from
which correct traversals can be generated automatically.
The special purpose language is a
traversal strategy language for specifying navigation through objects.
The product is
the result of 10 years of research/development in Adaptive Programming (AP)
which started with the Law of Demeter.
The traversal strategy language
allows for a better way to follow the
Law of Demeter by replacing the many small traversal methods with simple
traversal strategies.

Why is the product useful? The product has the following benefits
compared
to Java without traversal support:

Programs become more flexible and adapt automatically
to a wide variety of structural changes. If the
adaptation is not the desired one, for
typical programs it is much easier to change the
traversal strategy than the corresponding object-oriented program.
The flexibility of software written with DJ facilitates
rapid application development.

Programs are more readable
since traversal strategies are a part of the program, i.e., the programmer's
high-level intentions are an integral part of the program (traversal
strategies), rather than having to
be written as comments or external documentation.
This means that a part of the rationale capture for the program is an integral
part of the program itself. Without the explicit traversal strategies,
the programs are harder to read since often a large number of function
calls would need to be studied to get the equivalent information in the
strategies.

Programs become simpler because traversal strategies
are simpler than the detailed traversals.

DJ integrates Generic Programming and Traversal-Visitor style
programming giving you the benefit of both.
DJ is a programming tool that integrates Generic Programming (GP)
(best known from
the C++ Standard Template Library) using the
Java Collections Framework
with Traversal-Visitor Programming (best known from the Demeter work and
the Visitor Design pattern). Both Generic Programming
and Traversal-Visitor Programming
are made more generic by using
structure-shy traversal strategies leading to a programming system that
is easier to use than Java alone. The additional genericity
comes from a parameterization over the UML class diagram that
is produced by DJ from the Java program.
The interface to the Java Collections Framework
is very simple by providing adaptor methods
from traversals to containers.
It needs to be stressed, however, that DJ is already very useful without
using Generic Programming by only using the three actions
traverse, fetch and gather (which probably give you 60% of the benefits
of DJ).

The product has the following disadvantages compared
to Java without traversal support:

At a minimum, three concepts must be learned:
class graph, traversal strategy graph,
and traversal graph. Advanced users also need to learn the concept
of object graph slice and the Java collection class library.
The traversal strategy graph
language must be learned. Traversal strategies specify navigation intent
and are expressed as Java strings that must be syntactically correct.

DJ uses reflection to interpret and execute the navigation.
Therefore in the current implementation of DJ all traversals run
slower than hard-coded or generated traversal code.
A future version of DJ will have an option to compile the traversals that
are statically known.

Platforms. DJ is implemented in Java (using Demeter/Java, the big sister of DJ)
and available
in 100% pure Java source form.
It runs on all platforms where Java runs.

Acknowledgements:
Implemented by Josh Marshall and Doug Orleans using the
AP Library
by Doug Orleans.
Lars Hansen proposed an early idea and Johan Ovlinger nurtured it
with his TAO system inside Demeter/Java.
Cristina Lopes implemented at Xerox PARC a similar system for a version of Lisp:
AP/S++: A CASE-study of a MOP for Purposes of Software Evolution
(ftp://ftp.ccs.neu.edu/pub/people/lieber/reflection-adaptive.ps).
Several people recommended the development of DJ,
among them Harold Ossher (IBM),
Luis Blando (GTE Labs), David Wagstaff (Novell).

We develop DJ using a Bazaar approach. Please send us your bug fixes and
improvements
to lieber@ccs.neu.edu and we will integrate them.