Skip to main content
Engineering LibreTexts

9.1: Introduction

  • Page ID
    36378
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)

    The collection classes form a loosely-defined group of general-purpose subclasses of Collection and Stream. The group of classes that appears in the “Blue Book”1 contains 17 subclasses of Collection and 9 subclasses of Stream, for a total of 28 classes, and had already been redesigned several times before the Smalltalk-80 system was released. This group of classes is often considered to be a paradigmatic example of object-oriented design.

    In Squeak, the abstract class Collection has 98 subclasses, and the abstract class Stream has 39 subclasses, but many of these (like Bitmap, FileStream and CompiledMethod) are special-purpose classes crafted for use in other parts of the system or in applications, and hence not categorized as “Collections” by the system organization. For the purposes of this chapter, we use the term “Collection Hierarchy” to mean Collection and its 37 subclasses that are also in the system categories labelled Collections-*. We use the term “Stream Hierarchy” to mean Stream and its 10 subclasses that are also in the Collections-Streams system categories. The full list is shown in Figure \(\PageIndex{1}\). These 49 classes respond to 794 messages and define a total of 1236 methods!

    In this chapter we focus mainly on the subset of collection classes shown in Figure \(\PageIndex{2}\). Streams will be discussed separately in Chapter 10.

    The collection classes in Squeak.
    Figure \(\PageIndex{1}\): The collection classes in Squeak. Indentation indicates subclassing. Italicized classes are abstract. Bold classes are described in the “Blue Book".
    Some of the key collection classes in Squeak.
    Figure \(\PageIndex{2}\): Some of the key collection classes in Squeak.

    1. Adele Goldberg and David Robson, Smalltalk 80: the Language and its Implementation. Reading, Mass.: Addison Wesley, May 1983, ISBN 0–201–13688–0.


    This page titled 9.1: Introduction is shared under a CC BY-SA 3.0 license and was authored, remixed, and/or curated by Andrew P. Black, Stéphane Ducasse, Oscar Nierstrasz, Damien Pollet via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.