December 2004
Beginner
936 pages
20h 1m
English
So far, you have worked with single and multiple inheritance to create is-a relationships.
Today, you will learn
• What aggregation is and how to model it (the has-a relationship)
• What delegation is and how to model it
• How to implement one class in terms of another
• How to use private inheritance
You have seen in previous examples that it is possible for the member data of a class to contain objects of other class types. This is often called aggregation, or the has-a relationship.
As an illustration, consider classes such as a Name class and an Address class:
Class Name{ // Class information for Name};Class Address{ // Class information for Address};
As an illustration of aggregation, ...
Read now
Unlock full access