An Introduction to Object-Oriented Programming

By Timothy Budd

Study Guide for Chapter 15

Learning Objectives

After reading this chapter, you should be able to:

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 as you read the material.
  1. Explain how, in conventional programming languages, strong typing gets in the way of developing reusable container abstractions.

  2. What is the single most important feature of dynamically typed languages that allows the creation of reusable container abstractions?

  3. What is an iterator? What problem is being solved through the use of an iterator?

  4. What is the principle of substitutability?

  5. When container elements are all derived from a common base class, why is it easy to put an element into the container, but difficult to take it out? Why must such an element know its own dynamic type?

  6. How is inheritance used to hide the necessity of using casts in the containers that are derived from a common void * container?

  7. How is a template parameter like a function parameter? How is it different?

Contents copyright Timothy Budd, 1995.