|
|
In this chapter we will examine some of the most fundamental concepts that are essential to the tasks of data modeling and implementation. Once again, we’ll endeavor to recover the ordinary, non-technical meanings of some words that have become fuzzy technical terms.
Collections of Objects
Art museums usually contain paintings. Based on the previous chapter, we can recognize that a museum is a container, and the paintings are its contents.

Art museum curators often speak of their collections of paintings. For example, an art museum may say that it has a collection of Monet paintings, a collection of Morisot paintings, and a collection of Renoir paintings. Unlike containers and their contents, collections are not so strictly tied to physical relationships. Let’s see how this works.
It is common in the art world for museums to share their collections with each other, as a benefit to the art world and the public at large. For example, suppose there is an art museum on the East Coast of the United States that has a wonderful collection of oil paintings by the French impressionist Monet. This East Coast museum will package up part of its collection of Monet paintings and send them to a museum on the West Coast, for display there for some months, before they are shipped back to the museum that owns the collection.
Now, while those paintings are on the West Coast, they are still considered part of the collection belonging to the East Coast museum, even though they are not physically contained in that museum. So we can see that a collection can exist inside or outside any particular container.
The paintings on loan to the West Coast museum might be displayed side-by-side with paintings belonging to the West Coast museum, but they would never be considered to be part of any collection of the West Coast museum. The East Coast museum always owns its collection, no matter where the members of that collection might be. This is evidence that our concept of collection, like our concept of containment, involves exclusivity. We often describe this exclusivity in terms of ownership. Something owned by one person or group is not owned by any other person or group. Something that is a member of one collection may not also be a member of another collection—except transitively: a collection may belong to another collection.
We can see from this example that the objects belonging to a collection may or may not be in the same container at any one time. Although a container, being an object, always has but one location at any one time, a collection of objects is not necessarily localized. This gives us a clue that, while a container is an object, a collection is not an object; a collection is merely a concept.
Our hypothetical East Coast art museum has paintings and other drawings of many types, including oil paintings, watercolors, charcoal and pencil sketches, pastels, and engravings. The paintings can have many subjects, including landscapes, still-lifes, and portraits. The museum curators often speak of the paintings in their collection according to any of these characteristics, and will call these collections, too. A painting by Monet might be a landscape and an oil painting, so that, when a curator speaks of “our Monet collection,” “our collection of landscapes,” and “our collection of oil paintings,” the oil landscape by Monet is included every time. Thus, we can see that, in ordinary English, an object can be in multiple collections at the same time, provided that all of the collections have the same owner.
Sets of Concepts
We have seen that a collection is conceptual, even when the members of the collection are objects. It is also possible to have a collection of concepts. In such a case, both the collection and its members are conceptual. However, we don’t usually use the word “collection” in connection with concepts. We will usually say that we have a set of concepts.
We know that numbers are concepts. Mathematicians have a special notation that they’ve developed just so that they can talk about sets of numbers (and other things). It is called set notation. Very simply, a list of numbers is enclosed in curly braces, as in
{1, 2, 3}
The whole expression is called a set. The set just given consists of the numbers one, two, and three.
One of the interesting things about sets of conceptual entities, such as sets of numbers, is that you can destroy the set notation that describes the set, but that doesn’t destroy the set itself, nor its members. A set of numbers, and the numbers themselves, don’t exist just because they are written down. This is in contrast to collections of objects. A collection of objects can be destroyed in a number of ways:
Membership of concepts in sets is not exclusive. A single concept can be in multiple sets at the same time. Consider as an example the number 2. It is in all these sets simultaneously:
In fact, we could go on inventing sets ad infinitum for 2 to be part of.
Although membership in a set is not exclusive, two sets can be exclusive of each other. For example, the set of even numbers is exclusive of the set of odd numbers. Any given integer is a member of only one of those two sets. But, as we have seen, an integer can be a member of many non-exclusive sets at the same time.
Sets of Objects
We have covered collections of objects and sets of concepts. We don’t generally speak of collections of concepts. But we can speak of sets of objects. A set of objects is very similar to a collection of objects, except without the concept of ownership. For instance, we could speak of the set of cars in a parking lot at a given moment, and the set would be understood, even though the cars had no one owner. A set, like a collection, is a concept, even though members of the set may be objects.
And, as with sets of concepts, some sets may be exclusive of each other. A given painting may not simultaneously be a pastel and watercolor, and it may not simultaneously be a portrait and a landscape. But a painting may simultaneously be in the pastel set and the landscape set.
Types and Classes

Long before computers were invented, we humans recognized similarities between things, categorized those things by their similar characteristics, and named those categories. For example, humans observing a herd of elephants roaming the African plains would recognize that all the individual animals in the herd shared common characteristics, including that they were gray in color, had long snouts, and grew to enormous size. These humans developed a shared concept of the common characteristics, and in order to be able to communicate about that shared concept would give that shared concept a name; in English, the name of the shared concept is “elephant”. Once the category of animals was named, every time such an animal was seen, instead of describing the animal’s characteristics, a reference to the category (“an elephant”) was sufficient to communicate about it. Other animals were similarly categorized based on common characteristics, and the categories were given names; for example, lion, tiger, zebra, etc.
There is a rich set of words in English related to this innate human activity of classification, and these words are synonyms of each other. Some of these words are:
|
category |
class |
classification |
division |
family |
|
genus |
kind |
order |
species |
type |
The worlds of database and software development have heavily overloaded two particular words related to classification, namely the words “type” and “class”, giving them specialized meanings that are actually at the core of one set of problems plaguing computer science. In our refined terminology we will use these two words with great caution and specificity. Since “type” and “class” are synonyms in ordinary English, this choice of specialized meanings is arbitrary from an English point of view. We will see in part III how these choices are influenced by object-oriented programming languages, but how quite different definitions for these terms clarify our thinking.
We will use the word type to mean something that designates a set, usually a set of concepts but also possibly a set of objects. We will use the word class to mean a description of the structural and/or behavioral characteristics of potential or actual objects. In cases where we don’t have enough context to choose between “type” and “class”, the word “kind” will be used, meaning “some kind of category, but we’re not sure whether it’s a type, a class, or something else”.
Types Designate Sets
What does it mean for a type to “designate” a set? We mean that there is some means by which we can identify the members of the set, and distinguish those from things that are not in the set. It turns out that there are many ways to designate sets. Here are some examples of types that designate sets of concepts:
There are additional ways to designate sets which we’ll see later in the book.
It’s important to keep in mind that a type—a designation of a set—is not the set itself. For example, the phrase “natural numbers” consists of words, but the set it designates is quite different, consisting only of numbers.
Here are some examples of types that designate sets of objects:
Again, there are additional ways to designate sets of objects, and again, the designation of the set is not the set itself.
Classes Describe Objects
Above we said that a class is a description of the structural and/or behavioral characteristics of potential or actual objects. In our refined terminology, we would say that the word “elephant” is a class, because it references a structural description of the animals in question. Another example of a class is a set of drawings and blueprints describing a house or houses that are built or to be built.
The term “elephant” indirectly designates a set of animals; specifically, all those animals matching the description associated with the shared concept of an elephant. This would include elephants that currently exist, elephants that have existed, and even elephants that might yet come into existence. We don’t know exactly how many elephants are or will be in this set, but the word “elephant” nonetheless identifies the set. A class, therefore, is a kind of type. It differs from other types in that a class can only designate sets of objects. One cannot have a class of concepts, in this restricted sense of the term.
When we get into the specialized terminology of Concept and Object Modeling Notation (COMN) in part III, we will see that these definitions of type and class line up to some extent, though not exactly, with their definitions in object-oriented programming. (The differences are significant.) When discussing software and data, the term class will be used solely to refer to a designation of a set of objects that exist or might exist in a computer’s memory or storage, by describing the structural and/or behavioral characteristics of objects belonging to the class. The term type will be used to refer to the designation of sets of concepts or objects which may exist in the computer or in the real world, and which are not designated solely by descriptions of structure or behavior.
Three Aspects of Types and Classes
With regard to types and classes, we have three things separately:
Chapter Glossary
type : something that designates a set
class : a description of the structural and/or behavioral characteristics of potential or actual objects
collection : a set of objects having a single owner
|
Key Points
|