December 2003
Beginner
288 pages
7h 8m
English
We have already seen that composition represents a part of a whole. Although the inheritance relationship is stated in terms of is-a, composition is stated in terms of has-a. We know intuitively that a car “has-a” steering wheel (see Figure 9.2).

Is-a and Has-a
Please forgive my grammar: For consistency, I will stick with “has a engine,” even though “has an engine” might be grammatically correct. I do this because I want to simply state the rules as “is-a” and “has-a.”
The reason for using composition is that it combines systems into less complex parts. This is a common way for ...
Read now
Unlock full access