Demeter Interfaces: Adaptive Programming Without Surprises

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.

[1]  Karl J. Lieberherr,et al.  DJ: Dynamic Adaptive Programming in Java , 2001, Reflection.

[2]  G. Kiczales,et al.  Aspect-oriented programming and modular reasoning , 2005, Proceedings. 27th International Conference on Software Engineering, 2005. ICSE 2005..

[3]  Karl J. Lieberherr,et al.  Preventive Program Maintenance in Demeter/Java , 1997, Proceedings of the (19th) International Conference on Software Engineering.

[4]  Karl Lieberherr,et al.  Adaptive Object-Oriented Software: The Demeter Method with Propagation Patterns , 1995 .

[5]  Kim Mens,et al.  Co-evolving code and design with intensional views: A case study , 2005, Comput. Lang. Syst. Struct..

[6]  Mitchell Wand,et al.  A language for specifying recursive traversals of object structures , 1999, OOPSLA '99.

[7]  Mira Mezini,et al.  Separation of Concerns with Procedures, Annotations, Advice and Pointcuts , 2005, ECOOP.

[8]  David H. Lorenz,et al.  Cona: aspects for contracts and contracts for aspects , 2004, OOPSLA '04.

[9]  Mira Mezini,et al.  Programming with Aspectual Components , 1999 .

[10]  Mira Mezini,et al.  Adaptive plug-and-play components for evolutionary software development , 1998, OOPSLA '98.

[11]  Karl J. Lieberherr,et al.  Demeter: a case study of software growth through parameterized classes , 1988, Proceedings. [1989] 11th International Conference on Software Engineering.

[12]  Jürgen Graf,et al.  Using pointcut delta analysis to support evolution of aspect-oriented software , 2005, 21st IEEE International Conference on Software Maintenance (ICSM'05).

[13]  Christian Koppen,et al.  PCDiff : Attacking the Fragile Pointcut Problem , 2004 .

[14]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[15]  Boaz Patt-Shamir,et al.  The Refinement Relation of Graph-Based Generic Programs , 1998, Generic Programming.

[16]  William G. Griswold,et al.  An Overview of AspectJ , 2001, ECOOP.

[17]  Kim Mens,et al.  Managing the Evolution of Aspect-Oriented Software with Model-Based Pointcuts , 2006, ECOOP.

[18]  Ravi Sundaram,et al.  Expressiveness and Complexity of Crosscut Languages , 2005 .

[19]  Matthias Felleisen,et al.  How to design programs: an introduction to programming and computing , 2001 .

[20]  Boaz Patt-Shamir,et al.  Traversals of object structures: Specification and Efficient Implementation , 2004, TOPL.

[21]  G GriswoldWilliam,et al.  Modular Software Design with Crosscutting Interfaces , 2006 .

[22]  Matthias Felleisen,et al.  How to Design Programs , 2001 .

[23]  Jonathan Aldrich,et al.  Open Modules: Modular Reasoning About Advice , 2005, ECOOP.

[24]  Yuanyuan Song,et al.  Modular software design with crosscutting interfaces , 2006, IEEE Software.