• Home
  • Textbooks
  • A little Smalltalk
  • Basics

A little Smalltalk

Timothy Budd

Chapter 1

Basics - all with Video Answers

Educators


Chapter Questions

Problem 1

Define the following terms:
$\begin{array}{ll}\text { object } & \text { subclass } \\ \text { message } & \text { superclass } \\ \text { receiver } & \text { inheritance } \\ \text { method } & \text { overriding } \\ \text { protocol } & \text { abstract superclass } \\ \text { class } & \end{array}$

Check back soon!
01:46

Problem 2

Give an example of a hierarchy from everyday life. List properties that can be found at each level, and distinguish those that are found in lower levels but not higher levels.

Christina Sorrentino
Christina Sorrentino
Numerade Educator

Problem 3

Read about the Simula class mechanism (Dahl 72) (Birtwistle 73). Compare and contrast this with the Smalltalk class mechanism.

Check back soon!

Problem 4

In the real world, objects are often classified in orthogonal ways, rather than in the tree-like hierarchy of Smalltalk. For example, the bald eagle and the condor are both birds of prey, but one is a North American bird and the other a South American bird. The robin is also a North American bird but is not a bird of prey. These two distinguishing characteristics are orthogonal in that neither can logically be said to be a superset of the other. Thus, forcing the classification into a treelike structure is either unnatural, inefficient, or both.
How might Smalltalk objects be classified in orthogonal ways? What problems does this introduce for the inheritance mechanism? How might these problems be overcome
$$
\begin{array}{c|c|c}
& {\begin{array}{c}
\text { Bird } \\
\text { of } \\
\text { Prey }
\end{array}} & {\begin{array}{c}
\text { Not a Bird } \\
\text { of } \\
\text { Prey }
\end{array}} \\ \begin{array}{c}
\text { North } \\
\text { American }
\end{array} & \begin{array}{c}
\text { Bald } \\
\text { Eagle }
\end{array} & \text { Robin } \\ \begin{array}{c}
\text { South } \\
\text { American }
\end{array} & \text { Condor } & ?
\end{array}
$$

Check back soon!