Rationale

This chapter presents a number of techniques that may be employed to structure object-oriented programs. These techniques may be regarded as idioms or guidelines augmenting the mechanisms provided by object-oriented languages. We discuss issues that arise in composition by inheritance, interaction through delegation and complex cooperation schemes such as the MVC paradigm. Also, an example illustrating event-driven control is presented.

Hints

The examples are all written in C++. They require (intimate) knowledge of C++. The intuition underlying each of these examples should be clear. However, the code needs to be explained in sufficient detail to convey its meaning. An operational approach, that is mentally simulating the execution of the code, works best in my experience. .so literatu

Project assignments

As subjects for papers you may recommend your students to study the as treated in  [Coplien92]. An interesting technical problem for a project is

Comments

Students seem to be quite fond of practical examples. The small schematic programs nicely illustrate the solution to control problems, which are very hard to grasp in their original setting.