December 2003
Beginner
288 pages
7h 8m
English
It is natural to think of objects as containing other objects. A television set contains a tuner and video display. A computer contains video cards, keyboards, and drives. Although the computer can be considered an object unto itself, the drive is also considered a valid object. In fact, you could open up the computer and remove the drive and hold it in your hand. Both the computer and the drive are considered objects. It is just that the computer contains other objects—such as drives.
In this way, objects are often built, or composed, from other objects—this is composition.
Although an inheritance relationship is considered an is-a relationship for reasons already discussed, a composition relationship is termed ...
Read now
Unlock full access