Objectives

This section shows a variety of ways in which objects may cooperate. The examples are drawn from window programming environments, notably Interviews and Smalltalk-80. In particular, a schematic implementation in C++ of the Smalltalk MV(C) paradigm is given.

Points to emphasize

Hints

Callback functions are at first somewhat hard to understand. The schematic implementations allow for a detailed treatment of the operational behavior of a collection of objects employing callbacks.

Questions

  1. What is a gadget? Give an example showing the interaction between a gadget and a window.
  2. Characterize the notion of event in a window environment. Characterize also the interaction between events and the gadget to which the event is directed.
  3. Sketch how the Smalltalk MV(C) paradigm may be implemented in C++. Give a simple example of its use.

Comments

The MV(C) paradigm provides a means for employing constraint-based programming. Its employment for the realization of the Smalltalk-80 programming environment clearly demonstrates its power.