An Introduction to Object-Oriented Programming
By Timothy Budd
Study Guide for Chapter 5
Learning Objectives
After reading this chapter, you should be able to:
-
Describe some of the ways in which an object oriented solution
to a problem differs from a more conventional, imperative solution.
-
Describe what it means to distribute responsibility for finding
a solution to a problem among many interacting agents.
-
Describe how an object-oriented active sentinel value differs
from a passive sentinel value.
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.
-
What does it mean to say that in the solutions to the eight
queens problem presented here, that the pieces themselves find
the solution?
-
Explain what it means to say a problem is being solved using
the technique of ``generate and test''. What portions of the
behavior we have assigned to the class Queen are involved
in generation, and what portions or involved in testing?
-
In the C++ solution the leftmost queen holds a null pointer value
in its neighbor field, whereas the solution in Objective-C uses
a sentinel value. What are the benefits of the use of the sentinel?
-
How does an active sentinel object differ from a simple endmarker
value? (An endmarker being a special value used to mark the
end of a list).
Contents copyright
Timothy Budd, 1995.