Demeter Interfaces: Adaptive Programming Without Surprises

  • Therapon Skotiniotis
  • Jeffrey Palm
  • Karl Lieberherr
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4067)


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.


Adaptive Method Class Graph XPath Query Adaptive Code Adaptive Programming 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    The Demeter Group: The DAJ website (2005),
  2. 2.
    Lieberherr, K.J., Orleans, D.: Preventive program maintenance in Demeter/Java (research demonstration). In: International Conference on Software Engineering, pp. 604–605. ACM Press, Boston (1997)Google Scholar
  3. 3.
    Lieberherr, K.J., Riel, A.J.: Demeter: A CASE study of software growth through parameterized classes. Journal of Object-Oriented Programming 1(3), 254–264 (1988), A shorter version of this paper was presented at the 10th International Conference on Software Engineering, Singapore, pp. 254–264, IEEE Press (1998)Google Scholar
  4. 4.
    Mezini, M., Lieberherr, K.J.: Adaptive plug-and-play components for evolutionary software development. In: Chambers, C. (ed.) Object-Oriented Programming Systems, Languages and Applications Conference. Special Issue of SIGPLAN Notices, pp. 97–116. ACM, Vancouver (1998)Google Scholar
  5. 5.
    Lieberherr, K.J., Lorenz, D., Mezini, M.: Programming with Aspectual Components. Technical Report NU-CCS-99-01, College of Computer Science, Northeastern University, Boston, MA (1999)Google Scholar
  6. 6.
    Ovlinger, J., Wand, M.: A language for specifying recursive traversals of object structures. In: OOPSLA 1999: Proceedings of the 14th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pp. 70–81. ACM Press, New York (1999)CrossRefGoogle Scholar
  7. 7.
    Sung, J.: Aspectual Concepts. Technical Report NU-CCS-02-06, Northeastern University, Master’s Thesis (2002),
  8. 8.
    Lieberherr, K.J.: Adaptive Object-Oriented Software: The Demeter Method with Propagation Patterns, p. 616. PWS Publishing Company, Boston (1996)Google Scholar
  9. 9.
    Lieberherr, K., Patt-Shamir, B., Orleans, D.: Traversals of object structures: Specification and efficient implementation. ACM Trans. Program. Lang. Syst. 26(2), 370–412 (2004)CrossRefGoogle Scholar
  10. 10.
    Lieberherr, K.J., Patt-Shamir, B.: The Refinement Relation of Graph-Based Generic Programs. In: Jazayeri, M., Musser, D.R., Loos, R.G.K. (eds.) Dagstuhl Seminar 1998. LNCS, vol. 1766, pp. 40–52. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  11. 11.
    Orleans, D., Lieberherr, K.J.: AP Library: The Core Algorithms of AP: Home page (1999),
  12. 12.
    Skotiniotis, T., Lorenz, D.: Conaj: Generating contracts as aspects. Technical Report NU-CCIS-04-03, College of Computer and Information Science, Northeastern University (2004)Google Scholar
  13. 13.
    Skotiniotis, T., Lorenz, D.H.: Cona: aspects for contracts and contracts for aspects. In: OOPSLA 2004: Companion to the 19th annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications, pp. 196–197. ACM Press, New York (2004)CrossRefGoogle Scholar
  14. 14.
    Kiczales, G., Mezini, M.: Aspect-oriented programming and modular reasoning. In: ICSE 2005: Proceedings of the 27th International Conference on Software Engineering, pp. 49–58. ACM Press, New York (2005)CrossRefGoogle Scholar
  15. 15.
    Lieberherr, K.J., Palm, J., Sundaram, R.: Expressiveness and complexity of crosscut languages. In: Proceedings of the 4th workshop on Foundations of Aspect-Oriented Languages (FOAL 2005) (2005)Google Scholar
  16. 16.
    Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading (1995)Google Scholar
  17. 17.
    Aldrich, J.: Open Modules:modular reasoning about advice. In: European Conference on Object-Oriented Programming (2005)Google Scholar
  18. 18.
    Sulivan, K., Griswold, W.G., Song, Y., Cai, Y., Shonle, M., Tewan, N., Rajan, H.: On the criteria to be used in decomposing systems into aspects. In: European Software Engineering Conference and International Symposium on the Foundations of Software Engineering (2005)Google Scholar
  19. 19.
    Sullivan, K., Griswold, W.G., Song, Y., Shonle, M., Tewari, N., Cai, Y., Rajan, H.: Modular software design and crosscutting interfaces. IEEE Software, Special Issue on Aspect Oriented Programming (2006)Google Scholar
  20. 20.
    Kiczales, G., Mezini, M.: Separation of concerns with procedures, annotations, advice and pointcuts. In: European Conference on Object-Oriented Programming (2005)Google Scholar
  21. 21.
    Kellens, A., Mens, K., Brichau, J., Gybels, K.: Managing the evolutions of aspect-oriented software with model-based pointcuts. In: European Conference on Object Oriented Programming (2006)Google Scholar
  22. 22.
    Koppen, C., Störzer, M.: PCDiff: Attacking the fragile pointcut problem. In: European Interactive Workshop on Aspects in Software (EIWAS) (2004)Google Scholar
  23. 23.
    Störzer, M., Graf, J.: Using pointcut delta analysis to support evolution of aspect-oriented software. In: 21st IEEE International Conference on Software Maintenance (2005)Google Scholar
  24. 24.
    Mens, K., Kellens, A., Pluquet, F., Wuyts, R.: co-evolving code and design with intensional views - a case study. Computer Languages, Systems and Structures (2006)Google Scholar
  25. 25.
    The Demeter Group: The DAJ beta website (2005),

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Therapon Skotiniotis
    • 1
  • Jeffrey Palm
    • 1
  • Karl Lieberherr
    • 1
  1. 1.College of Computer & Information ScienceNortheastern UniversityBostonUSA

Personalised recommendations