Rationale
This chapter introduces the basic
mechanisms of object-oriented programming.
It starts with some comments on the nature of
computing and the model underlying
object-based computation.
It then proceeds with a fairly
detailed discussion of the language
constructs provided by C++.
Also, some idioms
are presented that may be taken as guidelines
for the realization of abstract data types.
The chapter concludes with a discussion
of the benefits and pitfalls of
object-oriented programming in C++,
and a brief exploration of possible
extensions to the basic object model.
Hints
The treatment of the object-oriented
features of C++ requires at least
some knowledge of C++.
This is a good moment to present the material in the appendices,
especially the part concerning C++.
As textbooks on C++ I recommend
[Lippman91], [St91] and, for more advanced topics,
[Coplien92].
Project assignments
As possible subjects for a paper, I suggest
- safety features of C++
- the handler/body idiom
- differences between C and C++
Comments
A solid grasp of the basic mechanisms
of object-oriented programming is necessary to fully appreciate the more abstract concepts
underlying object oriented modeling.
In my experience, students like the simple example programs.
I advise them to try the programs and to experiment
with some simple modifications.