[Pl-seminar] Demeter Seminar on Structure-Shy Programming

Karl Lieberherr lieber at ccs.neu.edu
Wed Oct 24 10:41:34 EDT 2007

Fall Semester 2007
Demeter Seminar
Regular time: Thursday 10 - 11.30 am, 366 West Village H
20th BIRTHDAY: About 20 years ago Ian Holland walked into my office
with the idea
of the Law of Demeter which evolved to structure-shy programming.
According to the Java Lobby, the Law of Demeter is still considered
one of the TOP 7 tips
for writing quality software:
October 25: Therapon Skotiniotis: Making AP safer

We provide new semantics for a core subset of AP where strategies act as
interfaces between visitors and the underlying data structure. Visitors are
restricted and can only refer to nodes mentioned in the strategy. Furthermore
we restrict strategy definitions to select paths in our data structure that
are pair-wise expansions of the strategy's paths. These two restrictions
provide WYSIWYG paths and we show how our type system enforces these
restrictions. We also add constraints, allowing programmers to
express, and statically verify, invariants about the data structure's

We show that our new semantics statically rejects programs that current AP
tools (DemeterJ, DJ and DAJ) allow and cause unexpected visitor behavior.
Specifically, our new AP semantics guarantee that

  -- all constraints attached to the visitor are true for the given program's
  class hierarchy.

  and, if a visitor gets to execute then:

  -- it will reach a target object whose type matches the type of the target
  node in the strategy path

  -- the visitor is guaranteed to visit objects with the same type as the
  nodes selected by the strategy path and in the same order as in the strategy

November 1: Ahmed Abdelmeged: Structure-shy Programming in Haskell

We have a Demeter Seminar mailing list:

Please sign up at:

Seminar home page:

More information about the pl-seminar mailing list