Evolution of object behavior using context relations

  • Authors:
  • Linda M. Seiter;Jens Palsberg;Karl J. Lieberherr

  • Affiliations:
  • Computer Science Dept., Boston College, Chestnut Hill, MA;Laboratory for Computer Science, MIT NE43-340, 545 Technology Square Cambridge, MA;College of Computer Science, Northeastern University, 360 Huntington Avenue, Boston, MA

  • Venue:
  • SIGSOFT '96 Proceedings of the 4th ACM SIGSOFT symposium on Foundations of software engineering
  • Year:
  • 1996

Quantified Score

Hi-index 0.00

Visualization

Abstract

A collection of design patterns was described by Gamma, Helm, Johnson, and Vlissides in 1994. Recognizing that designs change, each pattern ensures that a certain system aspect can vary over time such as the operations that can be applied to an object or the algorithm of a method. The patterns are described by constructs such as the inheritance and reference relations, attempting to emulate more dynamic relationships. As a result, the design patterns demonstrate how awkward it is to program natural concepts of behavioral evolution when using a traditional object-oriented language.In this paper we present a new relation between classes: the context relation. It directly supports behavioral evolution, and it is meaningful at the analysis, design, and implementation level. At the design level we picture a context relation as a new form of arrow between classes. At the implementation level we use a small extension of C++. The basic idea is that if class C is context-related to a base class B, then B-objects can get their functionality dynamically altered by C-objects. Our language construct for doing this is a generalization of the method update in Abadi and Cardelli's imperative object calculus. A C-object may be explicitly attached to a B-object, or it may be implicitly attached to a group of B-objects for the duration of a method invocation. We demonstrate how the context relation can be used to easily model and program the Adapter, Bridge, Chain of Responsibility, Decorator, Iterator, Observer, State, Strategy, and Visitor patterns.