Has-a Abstraction

The most common type of abstraction is a division into parts. This takes a complex system, and separates it into component parts, which can then be considered in isolation.

This type of abstraction gets its name from a rule of thumb that can be used to identify when it is appropriate. The idea is to form an English sentence using the words ``has-a''. Examples are a car has an engine, and has a transmissin, a bicycle has a wheel. A window has a menu bar. When the senences sound right to your inner ear, you know you have an appropriate use of this form of abstraction.

Once identified, the has-a abstraction helps us decide how to break a system into smaller units, and then allows us to drop down a level of complexity when we consider each of the smaller components in isolation.

[audio] [real] Text to accompany slide15, in Chapter 2 of An Introduction to Object-Oriented Programming