Demeter/Java [5] is an implementation of AP for Java in the form of an efficiently executable design language. In Demeter/Java we add several innovations to AP including an improved form of the Visitor pattern from [2] is provided by the design language. Fig. 1 summarizes the impact of AP on the coupling between aspects. The grammar aspect includes class diagrams. The table holds for both Java and C++. For example, without AP, traversals and visitors are highly coupled: The visitor must have a method for each class in the traversal scope. With AP, the coupling between traversals and visitors is low: since both traversal strategies and visitors mention only the ``interesting'' classes.
Demeter/Java is much closer to Java than Demeter/C++ is to C++. Much of the syntax for propagation and transportation patterns could be eliminated from the core of the system. The most important generalization is probably the use of visitors instead of wrappers.
While Demeter/C++ uses a home-grown generic parser, Demeter/Java uses a commercial parser/scanner generator, namely the Java Compiler Compiler (JavaCC). JavaCC is used to create objects from robust object descriptions and an annotated UML class diagram which represents an LL(1) grammar. Demeter uses an improved form of the Interpreter design pattern [2]: class definition and grammar definition are integrated. Doug Orleans is the lead designer and implementor of Demeter/Java.
While in Demeter/C++ propagation patterns play a central role, in Demeter/Java they are only syntactic sugar to express certain commonly occurring traversals and visitors. The insight we gained was that propagation patterns were too big of an abstraction which is better decomposed into traversals and visitors with an attachment mechanism of visitors to traversals [8].
While in Demeter/C++ traversals are static, in Demeter/Java with the TAO (traversal as objects) extension, traversals may be computed at run-time. (Johan Ovlinger)
While in Demeter/C++ generic behavior for copying, printing, etc. was hardcoded for entire objects, in Demeter/Java you can selectively copy, print, etc. partial objects. This is accomplished by providing a CopyVisitor, PrintVisitor, etc. which is attached to a traversal selecting the subobjects of interest. (Geoff Hulten)
While in Demeter/C++ conditional traversals were expressed in an unpleasing way, Demeter/Java supports around methods. They provide for easier composition and provide also the foundation for dealing with exceptions in an aspect-oriented way. (Lars Hansen)