What is Demeter?

Overview (2 slides PDF format) Alternative: Overview (2 slides PowerPoint format)

Pronunciation: di me'tr. The stress is on e, which is pronounced like e in equal.

Answers: There are many answers depending on your point of view.

What is new?
An important concept of Demeter is to split software 
into at least two parts: The first part defines the objects.  
The second part defines the operations.  The goal of 
Demeter is to maintain a loose coupling between the 
objects and the operations, so that one can 
make modifications to either without serious impact 
on the other.  This cuts down significantly on 
maintenance time.

The most exciting and novel aspect of the Demeter 
technology is the concept of adaptive software based 
on traversal strategy graphs (strategies, for short). When you describe 
a traversal in a shorter form than writing it out 
completely, it is called a succinct subgraph 
specification.  Strategies
introduce a novel way of loosely coupling software 
artifacts to make evolution much easier. Strategies
are very important since they appear in
many aspects of object-oriented software development 
and other processes:

   groups of collaborating classes
   traversing objects
     e.g., navigation in UML/OCL
       file lec9.ppt
       files lec9*.ps
     defining collections and iterators for Generic Programming (see DJ tool)
   transporting objects
   copying objects
   marshalling objects
   parameterizing classes
   collecting resources
   queries in data bases
   expressing views
   defining participants of collaborations
   connecting components
   structure-shy knowledge representation
   structure-shy planning

The programs described above are 
adaptive programs of dimension 2 since
there are two parts. We also consider adaptive 
programs of dimension n: Adaptive programs are
specified by n complementary, collaborating parts, 
each one addressing a different concern of 
the application. Those programs are now called 
aspect-oriented programs.

Adaptive programming is the special case of aspect-oriented programming
where graphs and strategies are utilized.
The main goal of
adaptive programming is to separate concerns
by minimizing dependencies between the
complementary parts, so that a large class of 
modifications in one part has a minimum 
impact on the other parts.
The complementary parts approach has 
the advantage that programs become less tangled,
more flexible, understandable, and shorter, without loss of
run-time efficiency.
One or more of the dimensions must be expressed using 
strategies for the program to be called adaptive. 

A condensed list of 
applications of adaptiveness  
sorted by technique to achieve adaptiveness.
Law of Demeter
The Law of Demeter was developed early during the
Demeter project by Ian Holland et al. and it provided the
motivation for the work on Adaptive Programming.

We called it "Law of Demeter" because we discovered it while working
on Demeter but it is a general style rule for structure-shy programming.

Design Pattern Support

Demeter/Java provides excellent support for working with
design patterns. Traversal strategy graphs (strategies, for short)
are useful for capturing groups of collaborating classes
which are involved in a design pattern. 

Demeter/Java provides outstanding support for an 
improved form of the visitor design 
pattern. Behavior is expressed in terms of strategies and
visitors which are loosely coupled to each other and to
the class diagram.

What is the most general definition of Adaptive Programming (AP)

Adaptive Programming is the special case of 
Aspect-Oriented Programming
where at least one of the aspects is expressible in terms of
graphs and where the other aspects or components refer to the graphs using

In summary, AP is about adapting to changes in a graph and
about succinct specifications to achieve the adaptation.

begin definition

An adaptive program consists of n parts a1,a2, ... ,an,
where each part ai expresses a concern expressed in language Ai.
There is a combination function c which maps the n parts to an
executable program c(a1,a2, ... ,an).

In an adaptive program there must exist a graph-based concern, 
say A1, such that for a "large family" of changes S
to elements of A1, the result of the
combination function adapts to the change:

c(S(a1), a2, ... ,an) ~= c(a1, a2, ... ,an)     (adaptability cond.)

~= means that the two programs have "analogous", but different 
input-output behavior.

In AP, the adaptiveness is achieved by using the following mechanism:
Elements of A1 are mathematical structures consisting of sets and relations.
At least one of the concerns, say A2, is expressed in terms of succinct
specifications of a structure related to A1. A specification is succinct
if it is "much shorter" than the structure it specifies.

end of definition



Split program into two parts: behavior and class graph 
(e.g., a UML class diagram).
Behavior _adapts_ to many changes in class graph.
Behavior and class graph concern are connected by
strategies, i.e.,
succinct subgraph or succinct pathset specifications.

Solves following problem: Many maintenance and evolution tasks for 
object-oriented programs become simpler and even partially

The Demeter Method is a software design and 
development method for deriving object-oriented 
software from informal specifications, such as use 
cases and scenarios. The software is not described
directly at the object-oriented level, but at the 
adaptive object-oriented level with the double benefit 
that the software gets both shorter and considerably 
more flexible.  The software is called adaptive since 
it adjusts automatically to a large number of context 
changes. For other context changes it is easily adaptable 
by manual intervention.


Demeter provides a high-level interface to your favorite
object-oriented programming system. It defines a high-level
interface for defining the structure of your classes and
objects through class dictionaries. It also defines
a high-level interface for defining the behavior of your
objects through adaptive programs. When an application
is written using adaptive programming, it is much easier
to port to a new programming system, like going from C++
to Java.

Entitled ``Adaptive Object-Oriented Software: 
The Demeter Method with Propagation Patterns'', the 
book introduces the important concepts of adaptive 
software, such as class dictionaries, and propagation
patterns. It presents a simple process model on how to 
develop adaptive software.  The book is written for 
advanced undergraduate students, graduate students 
and professionals. The publisher is PWS Publishing

Framework Technology

Adaptive Plug-and-Play Components for Evolutionary Software Development 
is an OOPSLA '98 paper that makes the connection
between frameworks and AP. The APPC style of programming can be viewed
as programming with many little frameworks.

Modeling Behavior with Personalities 
shows how to improve framework technology using the Laws of personalities.

Research group
The developers of the Demeter technology.

Demeter Research Group.

Some easily accessible publications are:

   Karl J. Lieberherr, Ignacio Silva-Lepe and Cun Xiao,
   ``Adaptive Object-Oriented Programming using Graph-Based Customization'',
   Communications of the ACM, May 1994, pages 94-101.


   Ignacio Silva-Lepe, Walter Huersch and Greg Sullivan,
   ``A Demeter/C++ Report'',
   C++ Report, SIGS Publications, February 1994.


   To learn more, see WWW address:

The tools are distributed free of charge on the WWW
in source (and object) form for Demeter/Java,
Demeter/C++, Demeter/Perl5 and Demeter/CLOS.

   Users are very enthusiastic:

   From Bell Laboratories:
   "Demeter appears far superior to the methodologies for 
   C++-driving front-end CASE that we've seen from IDE 
   (Software Through Pictures) & Cadre."

   From Drexel University:
   "Extremely valuable --- I predict it will 
   sweep the industry"

   Read more feedback 
   on adaptive software technology. 

   Information about how to get the Demeter Tools/C++ 
   through the Internet is at: 


   Information about how to get the Java Tools Demeter/Java and DJ
   is at: 


The Greek goddess of Agrigulture.
  The Demeter project was named after Demeter because we were working
  on a hardware description language Zeus and we were looking for a tool
  to simplify the implementation of Zeus. We were looking for a tool name
  related to Zeus and we chose a sister of Zeus: Demeter.

  Later we promoted the idea that Demeter-style software development is
  about growing software as opposed to building software.
  We introduced the concept of a growth plan which is basically
  as sequence of more and more complex UML class diagrams.
  Growth plans are useful for building systems incrementally.

Back to Adaptive Programming = Demeter home page To learn more on adaptive software and to get periodic updates, send the message subscribe adaptive to majordomo@ccs.neu.edu ============================================================================