March 2001
Intermediate to advanced
416 pages
10h 27m
English
Inheritance provides a mechanism for reuse. Inheritance, as a mechanism for code reuse, was probably a significant factor in making object-oriented programming attractive in the 1980s and early 1990s. However, good object-oriented design calls for inheritance to be used in a very disciplined way—that is, in accordance with the substitution principle (see Substitution Principle on page 33). Under that discipline, inheritance is a mechanism for interface reuse instead of code reuse.[1] In our discussions in this chapter, we assume inheritance is used only in accordance with the substitution principle. Under that assumption, the set of test cases identified for a class is valid for a subclass of that class. ...
Read now
Unlock full access