156 ◾ Software Essentials
considering the dierent types of calculators available (simple, graphing,
pocket), the actual subtype of calculators held may vary over the lifetime of
the student. Only a temporary association exists between the object and the
subobject. e student need not hold the same calculator for a lifetime. e
subobjects may be passed in and out, may be shareable, or may be absent.
Independent of the implementation language, a containment relationship
provides much exibility because of its variability in cardinality, ownership,
and association. However, design dierences do exist because of language
dierences. Recall the memory management discussions in Chapters 4 and
5. In C++, memory management must be addressed fo ...