Demeter interfaces: adaptive programming without surprises

  • Authors:
  • Therapon Skotiniotis;Jeffrey Palm;Karl Lieberherr

  • Affiliations:
  • College of Computer & Information Science, Northeastern University, Boston, Massachusetts;College of Computer & Information Science, Northeastern University, Boston, Massachusetts;College of Computer & Information Science, Northeastern University, Boston, Massachusetts

  • Venue:
  • ECOOP'06 Proceedings of the 20th European conference on Object-Oriented Programming
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Adaptive Programming (AP) provides advanced modularization mechanisms for traversal related concerns over data structures in object-oriented programs. Computation along a traversal is defined through specialized visitors while the traversal itself is separately defined against a graph-based model of the underlying data structure with the ability to abstract over graph node names and edges. Modifying, under certain restrictions, the program's data structure does not alter the program's overall behavior. Even though AP is geared towards more easily evolvable systems, certain limitations of current AP tools hamper code reuse and system evolvability. Reasoning about adaptive code becomes difficult since there is no guarantee that a modification to a data structure will not alter the meaning of the program. Furthermore, adaptive programs are defined directly against a program's complete underlying data structure exposing unrelated information and introducing hardcoded dependencies decreasing reusability, modularity and hampering evolution. In this paper we present Demeter Interfaces through which a more thorough design method of adaptive programs allows for more resilient software. Traversal specifications and Visitors are defined against an interface class graph augmented with additional constraints that capture structural properties that must hold in order for the adaptive code to function correctly. A program implements a Demeter interface by providing a mapping between the program's concrete data structure and the interface class graph. We show how Demeter interfaces allow for higher levels of reusability and modularity of adaptive code while the static verification of constraints guards against behavior altering modifications. We also discuss the applicability of Demeter Interfaces to XML technologies.