An Introduction to Object-Oriented Programming
By Timothy Budd
Study Guide for Chapter 7
Learning Objectives
After reading this chapter, you should be able to:
-
Explain the concept of inheritance.
-
Distinguish between a subtype and a subclass.
-
Describe some of the ways in which inheritance is used.
-
Describe both the costs and benefits of the use of inheritance.
Study Questions
You may wish to use the print or save as command
on your web browser to produce a copy of this study guide.
That way you can fill in the answers to the questions as part of
your assimilating the information you learn in this chapter.
-
Give a simple intuitive description of inheritance.
-
Explain how a subclass can be viewed as both an extension and a contraction
of the parent class.
-
Explain the difference between a subclass and a subtype.
-
What is the principle of substitutability?
-
Explain why the principle of substitutability tends to be more important
in statically typed languages than in dynamically typed languages.
-
Give an example of each of the following forms of inheritance.
- Inheritance for Specialization
- Inheritance for Specification
- Inheritance for Construction
- Inheritance for Generalization
- Inheritance for Extension
- Inheritance for Limitation
- Inheritance for Variance
- Inheritance for Combination
-
Which of the following forms of inheritance generate subtypes in addition
to subclasses?
- Inheritance for Specialization
- Inheritance for Specification
- Inheritance for Construction
- Inheritance for Generalization
- Inheritance for Extension
- Inheritance for Limitation
- Inheritance for Variance
- Inheritance for Combination
-
Of the languages we are considering in this book, which require that all
classes inherit from a common base class? What are some of the advantages
of doing so?
-
Describe some of the benefits of using inheritance.
-
What is rapid prototyping?
-
Describe some of the costs of using inheritance.
-
Explain why raw execution speed should not be an overriding concern in
software development.
Contents copyright
Timothy Budd, 1995.