Perhaps a more appropriate title for this chapter would have been “Reusable Data Structures.” Comment on how each of the following entities or concepts contributes to the reusability of data structures:
a) classes
b) class template
b) class template
d) private inheritance
e) composition
a) Classes allow us to instantiate as many data structure objects of a certain type (i.e.,
class) as we wish.
b) Class templates enable us to instantiate related classes, each based on different type
parameters—we can then generate as many objects of each template class as we like.
c) Inheritance enables us to reuse code from a base class in a derived class, so that the
derived-class data structure is also a base-class data structure (with public inheritance,
that is).
d) Private inheritance enables us to reuse portions of the code from a base class to form
a derived-class data structure; because the inheritance is private, all public base-class
member functions become private in the derived class. This enables us to prevent
clients of the derived-class data structure from accessing base-class member functions
that do not apply to the derived class.
e) Composition enables us to reuse code by making a class object data structure a member
of a composed class; if we make the class object a private member of the composed
class, then the class object’s public member functions are not available through the composed object’s interface.
You might also like to view...
A tab that appears on the right side of the Ribbon only when certain objects are selected or when the insertion point is in a specific area of the document (e.g., header, footer) is called a(n) ________ tab
A) options B) formatting C) content D) contextual
A change in the appearance of an element in one or more specific ways, including rotating, scaling, skewing, or moving it, is known as a(n) __________.
A. transform B. translation C. animation D. keyframe animation
Use the ____ button on the FORM LAYOUT TOOLS ARRANGE tab to anchor controls.
A. Anchoring B. Alignment C. Format D. Padding
Each Office 2010 program has its own Help home page.
Answer the following statement true (T) or false (F)