Tension between Generality and Specialization

Nothing is bought without cost. Whenever you have reusable components, whether physical or virtual, there is a tension that arises between generality and specialization.

In software we see this as well. Reusability provides savings in development time, but generally at the cost of execution time. A reusuable component is often not as fast or small as a general purpose component.

So, while inheritance is a powerful tool, we must learn when it is appropriate to use, and always fully understand what it is buying and at what cost.

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