Cooperation
Instructor's Guide
intro,
inheritance,
delegation,
cooperation,
events,
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
- gadgets -- require, damage and draw
- events -- interception, callbacks
- -- model, view, control
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
- What is a gadget?
Give an example showing the interaction between a gadget
and a window.
- Characterize the notion of event in a window environment.
Characterize also the interaction between events and the gadget
to which the event is directed.
- 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.