Object Thinking
Object Thinking
Microsoft Press
A Division of Microsoft Corporation
One Microsoft Way
Redmond, Washington 98052-6399
Copyright © 2004 by David West
All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by
any means without the written permission of the publisher.
Library of Congress Cataloging-in-Publication Data pending.
iii
iv Table of Contents
Bibliography 309
Index 321
Acknowledgments
One name appears on the cover as author of this book, hiding the fact that
every book is a collaborative effort involving scores of contributors. Although it
is impossible to acknowledge and thank everyone who played a role, I can and
must name some individuals. Each is owed my personal thanks, and each
stands as a proxy for many others whom I acknowledge in my mind and heart.
Mary—without whom this would never have been done. My muse, my
friend, my spouse of twenty-one years.
Maurine, Bob, Sara, Ryan, and Kathleen—my family, whose support was
required and freely given.
Kevin—the best programmer with whom I have ever worked. You
proved, sometimes after a lot of discussion as to why it was impossible, that my
crazy ideas could be implemented.
Tom, Pam, Don, Dion, Julie, Kyle, Dave, Steve, and J.P.—our initial con-
tact was as student and professor, but you became colleagues and friends
and represent the hundreds of St. Thomas alumni who helped shape object
thinking and then applied it in the real world with notable success.
Tom and Ken—your technical review, insightful comments, correction of
errors, and honest advice were invaluable. This would not have been as useful
a book without your assistance.
Linda, Devon, Denise, Robin, Shawn, Joel, Sandi, and Elizabeth—the
editors and staff at Microsoft Press who smoothly dealt with all the technical
aspects of getting a book out the door (including an author with deadline
issues). An author could not have found a friendlier, more helpful, or more
professional group of editors and craftspeople with whom to work.
vii
Preface
■ The reader will be asked to read and digest a lot of history and
philosophy before embarking on the more pragmatic aspects of
object thinking.
■ The author will unabashedly, adamantly, and consistently advocate
behavior as the key concept for discovering, describing, and design-
ing objects and components.
■ The centrality of CRC (Class-Responsibility-Collaborator) cards as an
object thinking device or tool will likely be viewed as anachronistic
and irrelevant since UML (Unified Modeling Language) has achieved
the status of de facto standard.
■ The apparent indifference, or even antagonism, toward formalism
and the formal approaches to software specification that are
intrinsic to the behavioral approach will concern some readers,
especially those trained in computer science departments at
research universities.
■ The emphasis on analysis and conceptualization—that is, on think-
ing—instead of on implementation detail might strike some readers
as academic.
It will take the rest of the book to explain why these differences are
important and necessary, but the motivation behind them is found in this 1991
quote from Grady Booch:
ix
x Object Thinking
1. Wirfs-Brock, Weiner, and Wilkerson’s Objected Oriented Design offers a behavior-based method, as
does Wilkinson’s Using CRC Cards.
xii Object Thinking
2. Peoples, James, and Garrick Bailey. Humanity: an Introduction to Cultural Anthropology. Belmont,
CA: Wadsworth/Thompson Learning, 2000.
Preface xiii
most readers will not share either that experience or that awareness, and they
need to know, explicitly, how those ideas have shaped the profession as we
see it today. I hope that even the most experienced practitioners will see some
new insights or have old insights brought to the forefront of their minds when
reading this material.
One final note. Readers of this book will tend to be professional software
developers or those aspiring to become professionals. Both groups share a
character trait—an eagerness to build, to practice. They are ready to “just do it.”
To them is directed the final message of this introductory chapter: please
be patient.
As a profession, we also tend to be abysmally ignorant of our own history.
In the words of the oft quoted, misquoted, and paraphrased philosopher,
George Santayana, “Those who cannot remember the past are condemned to
repeat it.” In computing, thanks to Moore’s Law, our repetition is disguised a bit
by scale—mainframe mistakes replicated on desktops, then notebooks, then
PDAs and phones, and then molecular computers.
As a profession, we tend to ignore the various influences—such as cul-
ture, philosophy, psychology, economics, and sheer chance—that have shaped
the practice of software development.
It is my belief that we cannot improve our intrinsic abilities as object and
agile software developers without an examination, however brief, of the histor-
ical and philosophical presuppositions behind our profession. We should not,
and cannot if we want them to truly understand, bring new members into our
profession without providing them with more than tools, methods, and pro-
cesses that they use by rote.
I encourage you to engage the book in the order presented, but feel free
to skip Chapter 1 if you’re prepared to take on faith the assertions made about
objects and object thinking in subsequent chapters.
Many readers will be a bit anxious to “get to the good stuff,” to see how
the book’s ideas are applied or how they manifest themselves in practice
(which is shown in Chapters 7 through 9). While I firmly believe that the
book’s initial chapters—as far afield as they might appear to be—need to be
covered first, I also recognize the need to at least foreshadow application. To
this end, I offer a continuing sidebar—the “Forward Thinking” sidebar—in
these initial chapters. This sidebar presents a sample application in bits and
pieces as a means of illustrating important ideas while satisfying the craving
for pragmatic examples.
Introduction
The time: 1968. A software crisis has been declared. Part of the crisis derives
from the fact that more software is needed than there are developers to produce
it. The other part of the crisis is the abysmal record of development efforts.
More than half of the projects initiated are canceled, and less than 20 percent of
projects are successfully completed, meaning that the time and cost overruns
associated with those projects were less than 100 percent and the software was
actually used to support the business.
The time: 2003. We have a lot of developers—part of the software crisis
has passed for the moment. Many of them are located in other countries
because too many managers seem to believe that developers are developers
and therefore go for greater numbers at lesser cost.
The skills, abilities, attitudes, and aptitudes of the development commu-
nity are, unfortunately, suspect. The “development community” means the
entire development community—from programmers to senior managers—in
the United States and the rest of the world. It is still the case that almost half of
all projects initiated are not completed. Those that are completed almost always
incur significant cost overruns. Quality—the lack thereof—is still a major issue.
Bloated, inefficient, bug-ridden, user-unfriendly, and marginally useful—these
are still common adjectives used to describe software.
The lack of significant improvement is not for want of trying. Numerous
proposals have been advanced to improve software development.
Software engineering provides an umbrella label for a spectrum of
improvement efforts ranging from structured programming to formal (mathe-
matical and logical) foundations for program specification to UML (unified
modeling language) to ISO 9000 certification and CMM (capability maturity
model) formalizations of the development process.
Sharing the goal of software improvement but rejecting the assumptions
implicit in software engineering, several alternative development approaches
have been championed. Creativity and art have been suggested as better meta-
phors than engineering. Software craftsmanship1 is the current incarnation of
this effort. Iterative development has as long a history as the linear-phased
development at the heart of software engineering.
xvii
xviii Object Thinking
Curiosities
Consider the following curious questions: Why is it that iterative development
has been acknowledged—even by those proposing sequential (waterfall)
development—as the “right” way to produce software, and yet
2. RUP—Rational Unified Process, an attempt to standardize and formally define the software develop-
ment process. Created and advocated by the same individuals behind UML (unified modeling lan-
guage), most notably Grady Booch, Ivar Jacobson, and James Rumbaugh.
Introduction xix
The long answer to these and similar questions is this book. The short
answer, and hopefully part of your motivation for reading this book, is that soft-
ware developers tend to be so focused on what and how that they forget to
explore questions of why.
3. Glass, Robert L., Facts and Fallacies of Software Engineering. Boston: Addison-Wesley, 2003.
xx Object Thinking
In his discussion of the foregoing facts, Glass notes that we have been
aware of these human differences since 1968:4
4. Sackman, H., W.I. Erikson, and E.E. Grant. “Exploratory Experimental Studies Comparing Online and
Offline Programming Performances.” Communications of the ACM, January 1968.
5. Some advocates of software engineering and process improvement will make claims of major suc-
cesses (SEI Report CMU/SEI-2001-SR-014).
Introduction xxi
6. Parnas, David Lorge, and Paul C. Clements. “A Rational Design Process: How and Why to Fake It.”
IEEE Transactions on Software Engineering. Vol. SE-12, No. 2, February 1986.
7. McBreen, Peter. Software Craftsmanship: The New Imperative. Boston: Addison-Wesley, 2001.
8. West, David. “Enculturating Extreme Programmers” and “Educating Xgilistas.”
9. Denning, Peter. ACM editorial.
10.Ken Auer, www.rolemodelsoft.com.
xxii Object Thinking
are they derived from any theory. The justification for the XP approach is based
on two simple empirical observations: “We have seen master developers do
these things” and “We have seen less proficient developers do these things and
become better.” Although XP does make claims to improve both product and
process, these are side effects—one is tempted to say mere side effects—of the
improvement in the human developers.
XP/agile approaches provide a solid foundation, but just a foundation.
What “Xgilistas”11 do is but part of what makes them master developers. What
they think and how they think are critically important as well. XP relies on max-
imized communication and storytelling as a means for enculturating new devel-
opers in appropriate ways of thinking. Thinking includes a value system, a
history, a worldview, a set of ideas, and a context. And XP encompasses an oral
tradition that has not, as yet, been reduced to ink and paper (and maybe cannot
be so reduced). Aspiring Xgilistas must become conversant with all of this
before they can attain true “master” status.
One component of the oral tradition, of the history, and of the common
worldview is the use of object-oriented approaches to design and program-
ming. Unfortunately, this is seldom made explicit in the XP literature. The terms
object and object-oriented do not appear in any of the first five books in the
Addison-Wesley XP series—except once, and that occasion points to an incor-
rect page in the text. However, object vocabulary and concepts are abundantly
evident. This discrepancy merely confirms that object thinking is presupposed
by those advocating XP. The primary goal of this book is to provide one small
contribution to help those following the Xgilista path—specifically, a contribu-
tion in the area of object thinking.
Object Thinking
Thirty plus years have passed since Alan Kay coined the term object-oriented.
Almost all contemporary software developers describe their work using object
vocabulary and use languages and specification tools that lay claim to the
object label. The ubiquity of object terminology does not mean, however, that
everyone has mastered object thinking. Nor does the popularity of Java. Nor
does the de facto standardization of object modeling embodied in UML. A pre-
diction made by T. Rentsch (cited by Grady Booch in 199112) remains an accu-
rate description of today’s development and developers:
11. A neologism—useful for labeling those that embody one or more of the approaches that fall under
the “agile” label.
12. Booch, Grady. Object-Oriented Analysis and Design with Applications, Second Edition. Boston:
Addison-Wesley, 1993.
xxiv Object Thinking
It’s also reasonable to assume that behavioral object thinking is only implicit
in the XP/agile culture because so few books or texts were ever written in sup-
port of this approach. Neither Beck nor Cunningham ever wrote such a book.
Rebecca Wirfs-Brock didn’t update her 1991 book describing behavior-based
object design until this year. Other efforts in this area (for example, Nancy Wilk-
erson’s book on CRC cards) were not widely known and have not been updated.
This is particularly unfortunate because the CRC card “method” as described
in the early 1990s did not incorporate all aspects of object thinking. In fact, I
believe that object thinking transcends the notion of method just as it transcended
programming languages. (You can do good object programming in almost any
language, even though some languages offer you more support than others.)
Object thinking requires more than an understanding of CRC cards as pre-
sented circa 1990. It also requires understanding some of the history and some
of the philosophical presuppositions behind object behavioralism, CRC cards,
and languages such as Smalltalk. It requires an understanding of the metaphors
that assist in good object thinking and an extension of the CRC card metaphor,
in particular, to include more than object identification and responsibility
assignment.
It is my hope that this book will promote such an understanding by cap-
turing at least part of the oral tradition of behavioral objects and making it
explicit.
1. Booch, Grady. Object-oriented Design: with Applications. Redwood City, CA: Benjamin/Cummings.
1991. ISBN: 0-8053-0091-0.
2. In the remainder of this book, I will generally use XP instead of XP and other agile methods as a short-
hand label for aspects common to all agile methods.
1
2 Object Thinking
The short quote from Grady Booch that opens this chapter contains three
key phrases that provide a framework for the discussion in the remainder of
this chapter:
Encapsulation
Barrier
operationX
Data
operationY Structure
operationZ
A traditional developer will almost always pick the diagram in Figure 1-1.
(Ken Auer calls this a “soccer ball” diagram because the segmentation resem-
bles that of a soccer ball.) An object thinker, on the other hand, will pick the
photograph. The soccer ball diagram has the advantage of familiarity to a tradi-
tional developer. It employs terms that are readily understood, and more impor-
tant, it reinforces premises critical to the mindset of traditional developers and
computer scientists. The diagram embodies Dykstra’s definition of a program as
data structures plus algorithms along with the idea of black box (enabled by the
encapsulation barrier) modularization.
Anthropomorphization—a big word for the practice of projecting human
characteristics onto objects—is fundamental to object thinking, which accounts
for the selection of the person depicted in the photograph by object thinkers.
As a thinking device—a metaphor or mental model—the soccer ball diagram
impedes object thinking by perpetuating old mental habits. For example, if the
diagram is an accurate depiction of an object, what is the difference between an
object and a COBOL program? There is none. A COBOL program encapsulates
data (data division) and operations (procedure division) and allows communi-
cation among programs (communication division). Object development—using
this model—will have a tough time being anything more than the creation of
lots of tiny COBOL programs.
4 Object Thinking
Note A COBOL program is, of course, a very large object. Inside the
program is a lot of messy stuff that’s not at all object-like. Object
COBOL differs from COBOL primarily in its ability to create smaller
programs—closer to the scale of classes/objects in other program-
ming languages—and enhancement of the communication division.
No substantial changes have been made—object COBOL is merely
COBOL rescaled. This is perhaps the best example of how the soccer
ball diagram reinforces traditional program thinking.
Here’s a final example (for now) of places to observe the object differ-
ence: three different models of a customer. Figure 1-3a is an entity model: cus-
tomer as data. Figure 1-3b is a UML class, and Figure 1-3c is an object model.
Both Figure 1-3a and Figure 1-3b reflect typical thinking about customers as a
collection of facts that must be remembered by the system. Both examples
name the “object” and list its attributes. An attribute is the name of some char-
acteristic, the value of which must be remembered (stored by) the system. The
UML model (Figure 1-3b) differs from the entity model (Figure 1-3a) only
because it also lists operations—functions that manipulate the attributes—collo-
cated with the attributes themselves. The similarity between entity and UML
models tends to ensure that the latter are subject to the same rules of normal-
ization as entities. This means that attributes of an object tend to get dispersed
among several different objects, increasing the total number of classes created
to hold facts about customers.
Figure 1-3c models a customer only in terms of what it does—what ser-
vices it might provide. (The front-facing facet of the cube model contains a list
of these behaviors or responsibilities.) What is known (by the system or anyone
else) about the customer is not important to understanding the object itself.
What the customer object needs to know to satisfy its advertised responsibilities
is important and is evident (partly) in the left facet of the object cube depiction.
6 Object Thinking
It’s not necessary to fully accept the Whorf-Sapir hypothesis (see sidebar)
to acknowledge that what and how we think varies with the language we
employ. Every mathematician knows the difficulty of translating elegant equa-
tions into English prose. Likewise, every programmer who has used more than
one programming language knows that statements easily and elegantly made in
one language (Smalltalk or Lisp, perhaps) are cumbersome and verbose when
translated into another (C++ or Java, perhaps). Developers are aware that dif-
ferent programming languages have very different idioms and styles despite
being, deep under the covers, equivalent.
These simple examples, which I’ll return to and expand upon later in this
book, point to some of the differences resulting from object thinking, but other
more general comments can also be made about object differences. Consider
the continuum depicted in Figure 1-4. At the far left, the developer is thinking
about the problem and its intrinsic nature, and at the far right, the developer is
thinking of the most precise details of implementing a program. As we move
from left to right, we tend to think using different languages. At the far left, we
employ (or, since most of you are developers, you collaborate with someone
who employs) natural language and the vocabulary of domain experts. At the
far right, our vocabulary and syntax are essentially equivalent to an instruction
set embedded on a processor chip.
8 Object Thinking
Conception Execution
Object thinking occurs across the continuum illustrated in Figure 1-4, but
it’s far more critical when engaged in activities to the left of the spectrum than
to the right. In fact, if you apply object thinking correctly when you are concep-
tualizing and decomposing your problem space, you create a context that
frames and guides your thinking as you move to activities on the right half of
the spectrum. Object thinking and object decomposition yield a very different
set of objects (modules) than would result from using traditional decomposi-
tion thinking based on an understanding of data structures and algorithms.
Objects exist in the world. They are observed by and interact with other
objects—some of them human beings—in that world. Human objects come to
have expectations about the nature and the behaviors of other objects in their
world and are disconcerted if an object appears different or if it behaves in a
manner contrary to their expectations. The “naive” or “natural” expectations of
objects represent a kind of integrity—what Alan Kay called a user illusion—that
must be respected.
The set of objects produced by object thinking must eventually be
designed and implemented, ideally without violating the integrity of the objects
themselves and without contravening any object principles or ideals. This poses
a new set of problems for developers as they design classes and code methods.
As we move rightward on the continuum, thinking is constrained by the lan-
guages (remember Whorf and Sapir) that we must employ. Programming lan-
guages can lead us far from object thinking. Even if the language is relatively
benign (a “pure” OO programming language), it is still quite possible to write
nonobject code.
As I’ve said, although object thinking will yield observable differences
across the thinking continuum, the differences will be far more evident, and
their “correctness” will be essential, on the left. On the right of the continuum,
the differences will tend to be collective rather than individual. For example,
idiosyncrasies of syntax aside, it can be very difficult to differentiate a specific
object-oriented method from a similarly specific procedural function. But the
complete set of methods and the manner in which they are distributed among
the objects (modules) will be quite different than would be the case in imple-
mentations conditioned upon traditional computer thinking.
Chapter 1 Object Thinking 9
In what other ways will object thinking manifest itself? What metrics will
be different? Dramatic and frequently claimed measures include the oft-cited
reductions in lines of code and the amount of lead time required to deliver an
application. Lines of code, for example, in a well-thought-out object application
will be at least an order of magnitude fewer (sometimes two orders of magni-
tude). This means that a 1 million–line program, written conventionally by
developers thinking like a computer, can be duplicated with object thinking in
100,000 lines of code or fewer. Time to delivery is reduced by at least 50 per-
cent and often by as much as 70 percent. Projects scheduled to take 2 years to
complete can be done in 8 to 12 months.
Dramatic results were routinely reported in the early days of object enthu-
siasm but have died off in recent years because, I would claim, of a return to
dominance of old thinking habits. This does not mean that object thinkers
reverted to form—merely that as the number of people using OO programming
languages and tools but not object thinking expanded dramatically, the collective
ratio of object thinking to traditional thinking became smaller. When entire teams
were object thinking and were almost certainly engaged in the rich iterative com-
munication practices advocated by XP, the results were dramatic. If less than 10
10 Object Thinking
percent of the team members are object thinking and the others are thinking
traditionally, the overall effort will reflect the thinking style of the majority.
Mark Lorenz3 and Jeff Kidd published a set of empirically derived metrics
for successful object projects. (Although their book is somewhat dated, metrics
derived from my own consulting experience—which continues to the
present—are consistent with those reported by Lorenz and Kidd.) Following is
a selection of metrics based on the results reported by Lorenz and Kidd but
modified by my own consulting experience and observations. The debt to
Lorenz and Kidd must be acknowledged, but they should not be held account-
able for my interpretations and extensions.
3. Lorenz, Mark, and Jeff Kidd. Object-Oriented Software Metrics. Englewood Cliffs, NJ: Prentice Hall.
1994. ISBN 0-13-179292-X.
Chapter 1 Object Thinking 11
■ Lines of code per method: average of fewer than seven for Smalltalk
(15 for languages such as C++ and Java).
■ Percentage of methods requiring inline (comments) documentation:
about 60. Practitioners of XP would think this a very high percent-
age. Refactoring, naming conventions, other idioms, and coding
standards should move this figure much closer to 0 percent.
■ Average method complexity using the following weights for each
occurrence of the noted item—API calls 5.0, assignments 0.5, arith-
metic operators or binary expressions 2.0, messages with parameters
3.0, nested expressions 0.5, parameters 0.3, primitive calls 7.0, tem-
porary variables 0.5, messages without parameters 1.0: average fewer
than 20 total points per method.
■ Number of case statements, nested conditionals, and nested branch-
ing statements in methods: zero (0). Lorenz and Kidd are quite care-
ful to cite a range for all of their metrics—a range that I have omitted
for dramatic purposes. The nature of the domain being modeled, the
application problem within the domain, and the relative skill of the
developers will affect the metrics cited. Treat the numbers as if they
were channel buoys—markers placed in the middle of the channel.
You do not have to hit the number, but sail too far to the side, and
you risk running aground.
4. One of the largest object projects of which I am aware through my consulting practice was tainted by
datacentrism. At the inception of the project, management mandated the translation of a recently com-
pleted enterprise data model into the domain class hierarchy—each entity in the data model became
a class in the object model. Despite using the right language, having some of the best object develop-
ers available in the country at that time, and having significant corporate support, the project took two
to three times as long to complete as necessary, cost far more than it should have, and encountered
numerous problems and complications that could have been avoided if the development team had
been allowed to rethink what they were doing using object thinking principles. Management deemed
the project “successful” because it was completed with no major overruns and saved the company a
lot of money. Compared to what might have been, however, it was a dismal failure.
12 Object Thinking
As the discussion of objects and object thinking proceeds, I’ll note many
other ways in which the object difference is observable. By the end of this
book, you should be able to clearly differentiate between object thinking and
traditional thinking solutions to problems. You should also be able to distin-
guish between “good” and “better” object solutions to a problem—recognizing
that design always yields a spectrum of potential solutions to any problem
and that evaluation of those solutions is partially subjective. Given that
observable and real differences exist between designs that result from object
thinking and from traditional thinking, what accounts for those differences? A
full answer will require the rest of this book, but I’ll introduce one essential
difference immediately.
5. Parnas, David Lorge. “Software Aspects of Strategic Defense Systems.” American Scientist 73 (1985).
pp. 432–440.
Chapter 1 Object Thinking 13
Note Many readers will be familiar with most of the eminent scholars
and practitioners cited in this book but not necessarily all of them.
From time to time, it will be useful to introduce these authorities and
provide some background regarding their accomplishments, confirm-
ing that their insights do indeed contribute to the issues at hand.
“Behind the Quotes” will be a continuing sidebar used for this purpose.
(continued)
Chapter 1 Object Thinking 15
the software could not be written and tested. The quote used here is from
a paper he wrote analyzing the problem and the abilities of software
developers to address that problem. That paper was part of the public
explanation of his resignation.
Few individuals can match the stature earned by Dr. Parnas in the
realm of software development. Fewer still can match his moral conviction
and willingness to uphold principle over mercenary considerations.
Now, it might be argued that the computer itself has changed substantially
since 1985 such that the thing we are trying to think like is substantially differ-
ent. We can investigate this claim by looking at programming languages. A pro-
gramming language represents a virtual machine. Therefore, wouldn’t an
object-oriented language such as Java represent a very different kind of com-
puter? If we “think in Java,” don’t we “think like objects” instead of engaging in
the kind of “computerthink” discussed by Parnas? Unfortunately, no. As we will
see in Chapter 2, programming languages are shaped by their own set of pre-
suppositions. Although you can implement object thinking in any programming
language, knowing an “OO” language is not sufficient to engender object think-
ing. In Chapter 3, an example is presented that shows just how easy it is to rep-
licate traditional thinking in a “pure” object language such as Smalltalk.
Languages such as Java and object-modeling tools such as UML effectively
define an object as the encapsulation of data structures and algorithms. Accord-
ing to this kind of definition, an object (as discussed previously in this chapter)
is nothing more than a very tiny COBOL program. A COBOL program is the
encapsulation of data structures (data division) and algorithms that operate on
those data structures (procedure division). (In fact, creating object-oriented
COBOL was a relatively simple task involving making the program smaller in
scope and increasing the power of the interface division to make it easier for
one COBOL program to interact with others.) This example shows that devel-
opers tend to perpetuate old thinking habits, albeit sometimes to a lesser
degree.
It’s useful to generalize Parnas’s observation to accommodate datacentric
development and development in nonprocedural languages such as Prolog and
Lisp. The essence of thinking like a computer is thinking in terms of the means
of problem solution. You view every development problem through the lens of
the means you intend to use to solve that problem. In datacentric development,
the means of solution consists of relations and relationships; for Prolog and
LISP, a set of propositions or state declarations.
16 Object Thinking
The generalization being made here is a variant of the adage, “If your only
tool is a hammer, every problem looks like a nail.” Following Parnas, I’m sug-
gesting that software development has been distorted and that all the problems
noted by Parnas persist because “our only tool is a computer, so every problem
looks like a virtual machine.”
So, what is the object difference? How is thinking like an object different
from thinking like a computer? Throughout this book, I’ll be working to provide
a complete answer to this question, but I’ll preview a couple of differences
here:
Problem = Solution
In Notes on the Synthesis of Form (Harvard University Press, 1964), Christopher
Alexander argues that “every design problem begins with an effort to achieve
fitness between two entities: the form in question and its context. The form
is the solution to the problem; the context defines the problem.” As an example
of “fitness,” Alexander points to the task of making a metal face smooth and
level. A standard block, smooth and level to a precision greater than required
by the target metal face, is inked and rubbed against the target. The presence or
absence of ink on the target indicates high and low spots that need to be
reground. The standard block is the context, the target face is the solution, and
it is clear how the standard defines the target.
I’ll develop the second point more fully in the next chapter, but again,
here’s a small preview. In their discussion of the principle of modular software
design, Witt, Baker, and Merritt 6 quote Plato and Christopher Alexander
(emphasis added):
Chapter 1 Object Thinking 17
6. Witt, Bernard I., F. Terry Baker, and Everett W. Merritt. Software Architecture and Design: Principles,
Models, and Methods. New York: Van Nostrand Reinhold. 1994. ISBN 0-442-01556-9.
7. Parnas, D.L. "On the Criteria to Be Used in Decomposing Systems into Modules," Communications of
the ACM, Vol. 15, No. 12, pp. 1053–1058, December 1972.
8. Brooks, Fred. “No silver bullet, essence and accidents of software engineering,” Computer Magazine,
April 1987.
9. Alexander, Christopher, Sara Ishikawa, and Murray Silverstein. A Pattern Language. Oxford University
Press. 1977.
18 Object Thinking
But they can be. Thinking like an object will lead to a greater degree of
isomorphism between objects found in the problem space (the enterprise
domain) and those employed in a solution space (the computer program) than
thinking like a computer. Isomorphism of the modules (objects) in problem and
solution space is a desirable, in fact essential, quality for software. I’ll demon-
strate the validity of these assertions in the coming pages.
Values
“We will be successful when we have a style that celebrates a consistent set of
values that serve both human and commercial needs: communication, simplic-
ity, feedback, and courage.” This statement introduces Kent Beck’s discussion
of values in eXtreme Programming eXplained and is a suitable introduction for
our own examination.
Communication
The communication value has two aspects: advocating greater communication
among all team members (developers, users, and managers) and promoting an
increase in the quality of communication. Object thinking directly contributes to
the latter aspect.
Imagine how much better your communication would be if all team mem-
bers spoke a common vocabulary and that vocabulary reflected a common
understanding of the problem domain and the essence of the problem being
addressed by the team. Imagine further that the concepts behind this vocabu-
lary reflected common understanding and did not require the customer side of
the team or the developer side of the team to memorize arcane terminology
employed by the other side.
Objects and object thinking promise the benefit of a common language.
Users, managers, domain experts, and developers will all use the same vocabu-
lary, grounded in a common understanding of that vocabulary, whether they
are discussing workflow or programming, requirements (stories) or refactoring. It
would be difficult to overstate the importance of a common language, especially
in an environment shaped by XP practices, almost all of which require deep
levels of communication among all participants in the development activity.
10. Beck, Kent. eXtreme Programming eXplained: Embrace Change. New York: Addison-Wesley. 2000.
ISBN 201-61641-6.
20 Object Thinking
Simplicity
Every aspect of object thinking shares a common goal with this XP value, which
equates to finding the simplest thing that could possibly work. Some examples:
Feedback
Object thinking’s contribution regarding feedback is somewhat indirect. Object
thinking evolved, in part, from the rapid prototyping school of software devel-
opment and shares the values of immediate feedback that arose there. Object
tools, such as the Smalltalk programming language, were optimized to provide
immediate feedback to developers. Both the use of an interpreted language and
the provision of multiwindowed development environments with browsers and
workspaces are manifestations of this desire for rapid feedback. Consider the
importance of the kind of immediate feedback described by Michael Hiltzik
when talking about Apple’s famous visit to Xerox PARC:
11. Christopher Alexander’s current works on the nature of order (http://www.patternlanguage.com) are
a quest to find this natural—but exceedingly powerful—simplicity.
Chapter 1 Object Thinking 21
Courage
Object thinking embodies precisely the kind of courage advocated by Kent
Beck:
■ Fear that change will be costly. Change is costly only if the effects of
a small incremental change in one part of a system are propagated
throughout the system and somehow precipitate widespread failures
in other parts of the system. Objects and object thinking assure that
change is a local, not a systemic, phenomenon.
Selected Practices
Although it would be possible to link object thinking with all of the practices
advocated by XP, a few merit explicit mention.
Metaphor
Metaphor is one of the most important but least understood practices of XP.
Some12 would claim that all thinking is metaphor-based. Kent Beck spent his
OOPSLA 2002 keynote talking about the importance of metaphor. Object think-
ing introduces a very different set of metaphors to use in talking and thinking
about software development. Object thinking metaphors are compatible with
XP and are an important complement to XP metaphoric thinking. The common
language provided by objects and object thinking provides a system of meta-
phors: every story, every test, every code module employs labels and terms that
metaphorically connect things in the domain with their simulated coded coun-
terparts.
Simple Design
Object thinking leads to simple design (usually the simplest design possible);
the least number of classes necessary; the fewest number of methods per class
possible; the simplest coding of methods; the avoidance of control, centraliza-
tion, and management classes; and simple scripts to simulate simple stories.
Refactoring
Refactoring is a way for “lazy” objects to give all the hard work to other objects.
Of course, when refactored and distributed to the proper objects, the work
turns out not to be hard at all. Whenever a task looks too hard for a good
object to perform by itself, it looks for others to share in the workload. Succes-
sive passing of hard work to others results in no object doing anything really
difficult—and usually in a collective solution that is intrinsically simpler than
would have been possible if the work had remained where originally assigned.
For example, suppose an airplane object has a responsibility to report its
location. This is a hard task because the location is constantly changing; a
12. George Lakoff, for one. His work on cognition represents a fairly dramatic shift in this area of study,
and his findings are very important for software developers.
Chapter 1 Object Thinking 23
On-Site Customer
The value of the on-site customer increases when she can fully participate in
the development work by virtue of the common vocabulary described earlier in
the “Communication” section. Object thinking not only creates a common
vocabulary but also allows the on-site customer to actually make design sugges-
tions and validate emerging designs as powerful representations of business
context and goals because the behavior of objects is simple, transparent, and as
familiar to the user as it is to the developer.
Coding Standards
Let me quote Kent Beck again: “Programmers write all code in accordance with
rules emphasizing communication through the code.” Object thinking pro-
motes this kind of coding. In fact, much of what will be presented on coding
later in this book is strongly influenced by Beck’s Best Smalltalk Practice Pat-
terns (Prentice Hall PTR, 1996), a style book for good coding. The coding metrics
noted earlier—lines of code per method and number of methods requiring
inline comments—are consistent with this XP practice.
As in the rest of this introductory chapter, I’m making assertions and
claims about object thinking—here specifically about object thinking’s compat-
ibility with XP—that will be proved (or not) in the chapters that follow.
24 Object Thinking
Thinking Is Key
There was a time when software development was considered an art. Art
implies individual talent based on innate skills: “Artists are born, not made.” As
computers became increasingly prevalent and essential to modern industrial
life, the dependence on artists to create the software that made them useful was
deemed undesirable. Some were even offended that a computer—the embodi-
ment of rationality, mathematics, and hard science—could be corrupted by
“mere” art. Increasing demand for programming and development services sug-
gested that the pool of true artists was too small; some other way would have
to be found to create the mass of individuals needed to fill all the jobs available.
In the early sixties, a movement to eliminate art from development came
to dominate the way we thought about the manufacture (the terms educate and
train were used, but only as euphemisms for manufacture) of software devel-
opers. Tools would automate most of the development tasks, defined method
would replace idiosyncratic problem solving, and documented process would
allow every step to be monitored, measured, and controlled. Even the most
mediocre human raw material could generate superior results if all the tools,
methods, and processes were deployed properly.
The preface to this book begins with quotes from Robert L. Glass that sug-
gest that the attempt to eliminate humans—or at least humanity—from software
development failed. Humans and human abilities are still the key to software
development success. This, in turn, suggests that we need to reconsider how
we go about enhancing human abilities instead of attempting to replace them
with machine capabilities.
One small step in this effort is to reconsider the “artists are born, not
made” dictum. Thousands of art schools (ranging from small commercial acad-
emies to graduate academic programs) claim to make artists. While it may be
true that no school “creates” artists on the order of Michelangelo or Georgia
O’Keefe quality, they do enhance the innate talents of individuals and make
them the best artist they can be. The education of artists is not focused on tech-
nique, process, or tools. The majority of an art education combines ideas, his-
tory, appreciation, experience, and constructive criticism.
An artist who is aware of the philosophy and history behind the practice,
an artist who is attuned to the community in which art is created and appreci-
ated, an artist who is capable of deep communication, is a better artist.
This book believes the same thing to be true of software developers—soft-
ware artists, software professionals. Mastery comes first from a thorough under-
standing of ideas. Understanding of ideas requires an understanding of
context, including historical context. Mastery is shared—it is a property less of
the individual than of the group—and is shared by those participating in a com-
mon culture.
Chapter 1 Object Thinking 25
Note I’ll say much more about cultural, and usually tacit, assump-
tions in the next two chapters.
Implicit in the idea of XP are other supporting ideas. Notable among these
is the idea of objects. This is not surprising given that XP gurus Ward Cunning-
ham and Kent Beck played a central role in the object revolution. They are the
inventors of the CRC (Class-Responsibility-Collaborator) card approach to
object analysis. The kind of object thinking introduced by Cunningham and
Beck was, and is, far more consistent with the original object idea than any of
the other popular approaches. The majority of developers claiming to be fol-
lowing object-oriented principles use the approach popularized by Rational
Software under the umbrella of UML with nuances introduced by the Java
programming language. Although Grady Booch, one of the principal contribu-
tors to UML thinking, clearly understood and advocated the object idea in his
early work, little of that understanding was codified into UML.
28 Object Thinking
those practices—you simply do them the way everyone does. Many of the XP
values and practices—for example, simplicity, stories, and refactoring—are
dependent in important ways on object thinking.
XP values and practices aren’t based on just any flavor of object thinking.
Object thinking in XP is based on the behavior-centric ideas about objects
exemplified in the CRC card approach. This approach to object thinking was
always a minority view and almost disappeared as UML attained dominance
and C++ challenged Smalltalk. (Visual Basic and Java superseded C++ in popu-
larity and offered an improvement for object thinking, but still not an optimal
environment.) Minority status was almost assured because of the close associa-
tion of the Smalltalk programming language with behavioralism, an “informal,
human-centric method” in a culture dominated by a bias in favor of formalism
and engineering.
Oft-cited reasons for the demise of Smalltalk and the behavioral ideas
behind informal methods (such as CRC cards) include performance issues, scal-
ing issues, and hyperbolic promises by expensive consulting companies lead-
ing to dramatic failures. These reasons appear to be little more than
rationalizations since every innovation in software has been subject to the same
criticisms. If an innovation can claim a formal foundation (relational databases),
it’s given time to overcome its limitations (or those limitations are ignored, and
the innovation is used in spite of them).
Note The same forces that are bringing XP to the forefront of soft-
ware development have generated a resurgent interest in the behav-
ioral approach to object thinking. In addition to this work, Rebecca
Wirfs-Brock and Alan McKean have published Object Design (Addi-
son-Wesley, 2003), and Richard Pawson and Robert Mathews have
published Naked Objects (John Wiley & Sons, 2002), both of which
strongly advocate and update behavior-based object thinking.
The purpose of this book is to help you become a better software devel-
oper and a better agile developer by improving the way you think. Thought,
however, is not simply a matter of rote memorization and repetition of a few
facts; it requires an understanding of ideas, of metaphors, and of history, topics
that many readers will find unusual in a computer book. Changing your mind
requires that you change your worldview, your culture, to include not only new
ideas but new values and new perspectives. This, in turn, requires a temporary
suspension of your current mindset. You must be prepared to take objects and
30 Object Thinking
object thinking seriously. An important aspect of taking the object idea seri-
ously is a willingness to change your mind, to give up (at least temporarily) old
and sometimes cherished ideas that are in conflict with new ones. Many of the
original proponents of object ideas overdramatized the need for a mental
change. (“Step one in the transformation of a successful procedural developer
into a successful object developer is a lobotomy.”) Predictably, this alienated
potential converts to the new ideas more often than it convinced them. I’ll try
to avoid this error in this book, while at the same time emphasizing those occa-
sions when you really must think differently in order to think in an object-ori-
ented fashion.
Of course, the object idea is not a single idea. It’s a complex of interrelated
ideas that provide a kind of philosophy or, perhaps more accurately, a mental
perspective. This perspective shapes the software developer’s thoughts con-
stantly and pervasively whenever a decision needs to be made, a problem
needs evaluation, or a design requires formulation. It matters little whether the
actual development act involves coding, testing, analysis, or design—the object
perspective influences that mental activity.
Object thinking will be most effective only after the developer internalizes
the object perspective. The same thing can be said about extreme program-
ming. In both cases, the novice is confronted with an array of terms, of prac-
tices, of examples that constitute a “gate” (to use Christopher Alexander’s and
many a Zen mystic’s terminology) that must be “passed through” to attain full
mastery. As I introduce vocabulary, models, and examples, remember that
these are but expressions of the idea (the gate), not the idea itself.
My excursion into history and philosophy in this book is intended to
expose the cultural foundations of our thinking about software development. It
will accomplish, hopefully, two things: expose the origins of divergent schools
of thought (XP and objects on one side; traditionalist computer scientists and
software engineers on the other) and provide the cultural context necessary to
fully assimilate the material in later chapters.
Onward
In this chapter, I tried to make a case for reading the rest of this book. Some
promises have been made, including that object thinking will make you a much
better software developer and that object thinking will make you a much better
XP practitioner.
Chapter 1 Object Thinking 31
The journey toward mastery of object thinking is not direct. I will ask you
to take a short detour into history and philosophy in order to develop the con-
text from which object thinking emerges. This context should make it easier to
understand the advocacy of behaviorism as well as why terms and concepts are
developed as they are in later chapters.
A secondary, and in many ways more important, reason for looking at phi-
losophy and history is to establish in the reader’s mind the themes and princi-
ples that can help you expand and shape the details of object thinking to
accommodate new situations. It’s my hope that you learn object thinking not by
rote but by actively and creatively applying ideas, concepts, and philosophical
principles.
Object thinking predates agile thinking, and both share deep common
roots. Object thinking and agile development, especially extreme program-
ming, are natural partners, sharing values and following common practices.
Understanding these commonalities at the level of ideas and values is essential
to the mastery of both. Exploration of these similarities will allow you to
develop synergies of thinking and to become more agile.
Welcome to the journey.
Forward Thinking
Introduction
The first five chapters of this book introduce a lot of ideas and back-
ground information that are fundamental to object thinking. As critical as
these ideas are, many readers will find themselves anxious to get to the
material that illustrates application of the ideas. This continuing sidebar—
an example application problem—will partially satisfy the urge to get to
the “good stuff” while providing illustration of the ideas presented in early
chapters.
Be forewarned: the example may involve concepts and models that
have not been introduced in the main text. You may have to take a few
things on faith until they are discussed properly.
(continued)
32 Object Thinking
Problem Statement:
The Universal Vending Machine Project
It’s your first big XP project—you are to head a team building the software
for a “better vending machine.” Vending machine sales are flat, but your
CEO notes that in Japan almost anything can be purchased from vending
machines, and in Scandinavia people can buy products from machines
using their cell phones. The hardware side of the company is busy design-
ing and building customized vending machines of all types, and your team
is to develop a common software base to run every type of vending
machine they might come up with.
The Universal Vending Machine (UVM) will be capable of dispensing
liquids as well as packages (cans or products in wrappers of various
kinds). Payment can be made using any or all of three kinds of currency
and coins (U.S. dollars, euros, and yen), debit cards (including a line of
prepaid debit cards sold by your company), and credit cards. Customers
can purchase goods from the machine via a Web-based transaction—also
using debit and credit cards. Each vending machine will initiate product
reordering via the Web. Restocking will be adjusted based on demand—
which products sell the most in the least amount of time.
To save money, your team will create a single program, one capable
of supporting the entire line of planned UVMs.
Given that this is an XP project, your customer will provide you with
stories, and you will write tests and code programs. Getting from stories to
code requires a fair amount of thinking, some open discussion, definition
of tests, occasional writing of notes, and drawing of diagram fragments.
Fortunately, you and your team are conversant in object thinking, so this
will not present an insurmountable challenge.
Philosophical Context
More often than not, the first question programmers ask when embarking upon
a new development project is, “What language will be used for implementation?”
There is usually no need to ask about method because some variation of a formal
structured approach is assumed. This is a very unfortunate situation.
The rising popularity of extreme programming (XP) and agile develop-
ment makes the method question an open one—again. I say again because in
terms of observable actions, XP and agile approaches are just the latest incarna-
tion of iterative development. Some form of iterative development has been
practiced in software since the 1960s and has usually been held to be superior
to the structured “waterfall” approach that is officially practiced. And yet, when
XP was proposed about four years ago, management and most practitioners
reacted as if it were a radical departure from accepted and acceptable practice.
Later in this chapter, we’ll look at the philosophical context behind this reac-
tion. But first it’s useful to explore how philosophy shapes the development
and utility of programming languages.
Whatever the answer to the programming language question, it is almost
always given for the wrong reasons. Even worse, it is given for reasons that are
never articulated and therefore never subject to reasoned judgment. Common
reasons (not necessarily expressed out loud) for adopting a programming lan-
guage include, in no particular order, the following:
■ Loyalty “We are a Microsoft shop; we use Visual Basic (or, today,
Visual C#).”
■ Bandwagon “Everyone is doing Java.”
■ Economics “Java programmers are a dime a dozen and completely
interchangeable—if we lose one, we can find a replacement easily.”
33
34 Object Thinking
that philosophy plays any role, let alone a critical role, in language design
because few have had the occasion or opportunity to explore the ideas behind
languages. Most object developers are not conversant with the philosophy of
objects—the subject of this book—and are therefore in a poor position to select
an implementation language reflective of object philosophy.
Developers who specialize in software for large-scale switching networks
(such as the phone system) should choose a language such as C because the
ideas and ideals that shaped that language are the same ones that shape the
thinking of developers working in that problem domain. (Even C++ will be
seen as an intrusion by those developers.) Scientific or engineering number
crunching? No reason not to use FORTRAN. Business applications? COBOL or
Visual Basic is perfectly fine.
Philosophical compatibility will allow you to be more expressive than if
you are trying to translate your thoughts into a “foreign” language because your
thoughts will naturally flow into the syntax of the implementation language.
1. All of the quotations regarding SIMULA, Smalltalk, and C++ languages are taken from the respective
chapters in ACM History of Programming Languages, ACM Press, 1978, Richard Wexelblat (ed.), or
History of Programming Languages II, Addison-Wesley, 1996, Thomas J. Bergin Jr. (ed.).
Chapter 2 Philosophical Context 37
Until the appearance of Java and C#, Smalltalk and C++ were the prime
contenders for the hearts and minds of object developers. The intensity of argu-
ment between advocates of each language is legendary. Both sides tended to
see Java as an interloper and tended to criticize those aspects of Java that
reflected their more traditional nemesis. Disagreement between Smalltalkers
and C++ers gains added interest from the fact that both claim to be the direct
heirs of another, older, language, SIMULA.
(continued)
38 Object Thinking
SIMULA
SIMULA did not start as a programming language, and during
all of its development stages, reasoning outside traditional
programming played an important part in its design.
latter option is correct. This will be important when we examine what Smalltalk
and C++ chose to borrow from SIMULA.
The concept of SIMULA began with an analysis of operations research and
the kind of complex systems being modeled and analyzed in that domain. The
first goal was to develop a “useful and consistent set of concepts” for modeling
the “structure and interaction” of elements in complex systems. The initial
objectives for the language were as follows:
the language, resulting in the ideas of objects, classes of objects, data and
implementation hiding, virtual procedures, and inheritance.
The legacy of SIMULA is twofold. First and most important from the per-
spective of object thinking, it provided an orientation (a philosophy) of giving
primary importance to understanding and modeling the problem domain. This
philosophy suggested the need for an elegant and powerful language that
would allow direct mapping of components in a domain to the modules
employed in the computer. Second, a number of original concepts, with appro-
priate vocabulary (object, class, inheritance), and some important implementa-
tion tricks (such as abstract data types and compiler-generated structures) were
invented or advanced as the language developed. What use did the inheritors
of SIMULA make of this legacy?
C++
Bjarne Stroustrup was motivated by the desire to create “a better C.” The C pro-
gramming language is noted for its power and conformity to machine architec-
ture, which ensures that C programs are maximally efficient in terms of machine
resources. This same power, however, made its misuse almost inevitable. Bugs
were easy to create and difficult to track down. Too many C programmers
lacked the discipline necessary to properly use the language. In SIMULA,
Stroustrup saw a model for introducing discipline into the C language:
Stroustrup was concerned with creating a “suitable tool” for projects such
as the writing of “a significant simulator, an operating system, and similar
systems programming tasks.” His focus was on the machine—system-level
programming—and on the program. Even though he found SIMULA to be an
excellent tool for describing systems and directly mapping application concepts
into language constructs, he seemed to be more concerned with performance
features of SIMULA than its descriptive capabilities.
Smalltalk
Philosophically, Smalltalk’s objects have much in common with
the monads of Leibniz and the notions of 20th century physics
and biology. Its way of making objects is quite Platonic in that
some of them act as idealizations of concepts—Ideas—from
which manifestations can be created. That the Ideas are
themselves manifestations (of the Idea-Idea) and that the Idea-
Idea is a-kind-of Manifestation-Idea—which is a kind-of-itself,
so that the system is completely self-describing—would have
been appreciated by Plato as an extremely practical joke.
Alan Kay clearly was not interested so much in what went on inside the
machine as in how the existence of the machine redefined the act of commu-
nication between person and machine. He saw the personal computer as a
potentially liberating and creative device, but its potential impact was inhibited
by the mode of communication. He saw that a better language, not program-
ming language, was required.
We should derive two lessons and one assertion from this brief historical
retrospective:
Customer
custId
description
addresses
creditData
In a store I might ask a customer, “Where would you like your purchase
delivered?” The customer would think a bit and give me back an address. But
in the relational example, I cannot ask the customer this question because the
customer does not know the answer. Instead, I have to ask the customer for his
customer number and then ask the collection of addresses in the Address rela-
tion, “Which of you belongs to customer custNo and also has the type value
delivery?” The implementation code gets even more “contrived and turgid”
when I attempt to account for the fact that the customer might want to use dif-
ferent delivery addresses at different times or for different situations. Analogous
design problems occur when you use strongly typed languages—the real world
is pretty fuzzy when it comes to classification—or other constructs that effec-
tively represent the computer but not the application domain.
Programming languages are concrete manifestations of a set of values, ideals,
and goals, which in turn reflect a more inclusive worldview or philosophical
context. Sometimes the language designer makes explicit philosophic deci-
sions, as did the three language developers just discussed. At other times, the
philosophy that shapes the programming language is invisible even to the
designer. Designers are humans and participate in a human culture. Most
humans are oblivious to their own culture: as the saying goes, “as blind to their
own culture as a fish is to the water in which it swims.” It would be expected,
therefore, that the general culture in which language designers live and work
Chapter 2 Philosophical Context 47
also plays a role in shaping the design of the language. And programming
languages are not the only artifact shaped by a prevailing culture. So too are
methods, processes, and even models.
Note The philosophy behind Smalltalk (and object thinking) does not
make the problem of selecting a correct address trivial, nor does it solve
problems with classification, but it does lead you in the direction of
simpler-to-implement and easier-to-modify solutions. For example, we
ask a human customer, “Where would you like this shipped?” Object
thinking suggests we create a customer object that can respond to
essentially the same message: shipTo. We assume that the customer
has a collection of possible addresses in mind and a rule that they
employ to decide which address to use. We probably assume that the
rule is context sensitive in some way, evaluating to different addresses
at different times. If we simulate all three of these objects—Customer,
addressCollection, and selectionRule —and distribute the problem of
“which address?” across the three, the solution is far simpler than what
would be necessary using a relational schema and an SQL query. The
classification problem is finessed, in a way, rather than solved by object
thinking and Smalltalk philosophy, which suggests that the real world is
fuzzy and any kind of hard-and-fast classification should be avoided
unless absolutely necessary. (Protecting programmers from making
errors is not an absolute necessity.) And when making classifications,
use set criteria that are intrinsic (such as DNA) instead of extrinsic (such
as presence of hair, warm blood, and lays eggs).
2. This is a historical observation, not an expression of ethnocentrism or an attempt to claim computing for
Europe and the United States. As will be seen in the rest of the discussion, this is more of an indictment
of the history of computing than a boast. Clearly the roots of computing and many of the most important
contributions to our understanding of computing come from many different places and cultures. The
argument will be made in the next few pages that most of computing, however, is firmly grounded in a
philosophical tradition that arose in Europe and formed the foundation of the Age of Reason.
48 Object Thinking
If this were true, all programming languages, methods, approaches, tools, and pro-
cesses would share a common, albeit deeply hidden, philosophical foundation.
This is clearly not the case. Every culture contains variations, or subcultures,
which exist at various levels of scale. In the next section, we’ll explore two com-
peting philosophical themes that have long been present in Western culture.
Forward Thinking
Metaphor and Initial Stories
In this particular case, our system metaphor is easy: it’s the vending machine
itself since our task is to provide software simulations of the behaviors
expected of a Universal Vending Machine. Even more helpful, we have an
entire row of vending machines in the hallway just outside our office that
we can use as references as we talk about what we are building.
The team sits down with the on-site customer to discuss the project.
We have all heard the CEO’s excited description of the UVM, so we have
a common starting point. The first cards that the customer writes include
the following. (The story title precedes the colon; the story narrative
follows the colon.)
The next step is to turn the stories into objects. Yes, yes—the next
explicit XP step is to write tests, but what tests, and what should the focus
of the tests be? You know that the code you produce will consist of class
definitions and methods. You know that the refactoring you will eventu-
ally do involves breaking up methods and redistributing methods among
your classes. So even though your next activity may be to write tests, your
next thinking will involve finding objects.
Because you have internalized object thinking, you can look at the
list of stories and foreshadow some likely outcomes. Stories 1 and 2 are
likely to involve the same set of objects and might be a single story. The
same thing is true of stories 13 and 15—dispensing is dispensing.
(continued)
50 Object Thinking
This tradition of thought, this worldview or paradigm, has been labeled for-
malism. Other names with various nuances of meaning include rationalism,
determinism, and mechanism. Central to this paradigm are notions of centralized
control, hierarchy, predictability, and provability (as in math or logic). If someone
could discover the tokens and the manipulation rules that governed the universe,
you could specify a syntax that would capture all possible semantics. You could
even build a machine capable of human thought by embodying that syntax in its
construction.
As science continued to advance, other philosophers and theoreticians
refined the formalist tradition. Russell and Whitehead are stellar examples. In
the world of computing, Babbage, Turing, and von Neumann ensured that
computer science evolved in conformance with formalist worldviews. In some
ways, the ultimate example of formalism in computer science is classical artifi-
cial intelligence, as seen in the work of Newell, Simon, and Minsky.
Formalist philosophy has shaped Western industrial culture so extensively
that even cultural values reflect that philosophy. For example, scientific is good,
rational is good, and being objective is good. In both metaphor (“Our team is
functioning like a well-oiled machine”) and ideals (scientific management,
computer science, software engineering), Western culture-at-large ubiquitously
expresses the value system derived from formalist philosophy.
Computer science is clearly a formalist endeavor. Its roots are mathematics
and electrical engineering. Its foundation concepts include data (the tokens), data
structures (combination rules), and algorithms (transformation and manipulation
rules). Behind everything else is the foundation of discrete math and predicate
calculus. Structured programming, structured analysis and design, information
modeling, and relational database theory are all prime examples of formalist think-
ing. These are the things that we teach in every computer science curriculum.
As a formalist, the computer scientist expects order and logic. The “goodness”
of a program is directly proportional to the degree to which it can be formally
described and formally manipulated. Proof—as in mathematical or logical proof—
of correctness for a piece of software is an ultimate objective. All that is bad in soft-
ware arises from deviations from formal descriptions that use precisely defined
tokens and syntactic rules. Art has no place in a program. In fact, many formalists
would take the extreme position: there is no such thing as art; art is nothing more
than a formalism that has yet to be discovered and explicated.
Countering the juggernaut of formalism is a minority worldview of equal
historical standing, even though it does not share equal awareness or popularity.
Variously known as hermeneutics, constructivism, interpretationalism, and
most recently postmodernism, this tradition has consistently challenged almost
everything advanced by the formalists. Iterative development practices, includ-
ing XP, and object thinking are consistent with the hermeneutic worldview.
52 Object Thinking
Unfortunately, most object, XP, and agile practitioners are unaware of this
tradition and its potential for providing philosophical support and justification
for their approach to software development.
Hermeneutics, strictly speaking, is the study of interpretation, originally
the interpretation of texts. The term is used in religious studies in which the
meaning of sacred texts, written in archaic languages and linguistic forms, must
be interpreted to a contemporary audience. Husserl, Heidegger, Gadamer,
Dilthey, and Vygotsky are among the best-known advocates of hermeneutic
philosophy.
discern the “meaning” of the diagram. The programmers will, of necessity, have
to interpret the document and find their own meaning (semantics) in its syntax.
And of course, it will be the programmer’s semantics, not the analyst’s/
designer’s syntax, that actually get implemented.
The hermeneutic conception of the natural world claims a fundamental
nondeterminism. Hermeneuticists assert that the world is more usefully
thought of as self-organizing, adaptive, and evolutionary with emergent prop-
erties. Our understanding of the world, and hence the nature of systems we
build to interact with that world, is characterized by multiple perspectives and
constantly changing interpretation. Contemporary exemplars of this paradigm
are Gell-Mann, Kauffman, Langton, Holland, Prigogine, Wolfram, Maturana,
and Varela.
As exotic and peripheral as these ideas may seem, they have been at the
heart of several debates in the field of computer science. One of the best exam-
ples is found in the area of artificial intelligence—the formalists, represented by
Newell and Simon, arguing with the Dreyfus brothers and others representing
hermeneutic positions.
54 Object Thinking
Note Allen Newell (before his death) and Herbert Simon were
among the leading advocates of traditional artificial intelligence—the
theory that both humans and machines are instances of “physical
symbol systems.” According to them, both humans and machines
“think” by manipulating tokens in a formal way (Descartes redux), and
therefore it is perfectly possible for a digital computer to “think” as well
as (actually better than) a human being. Hubert L. Dreyfus, working
with his brother, Stuart, has been one of the most vocal and visible
critics of traditional AI. What Computers Can’t Do (HarperCollins,
1979) and What Computers Still Can’t Do (MIT Press, 1992), written
by Dreyfus, present arguments based on the work of Husserl and
Heidegger against the formalist understanding of cognition.
Another example centers on the claim for emergent properties in neural net-
works. Emergence is a hermeneutic concept inconsistent with the formalist idea
of a rule-governed world. Arguments about emergence have been heated. The
stronger the claim for emergence by neural network advocates, the greater the
opposition from formalists. Current work in cellular automata, genetic algorithms,
neural networks, and complexity theory clearly reflect hermeneutic ideas.3
3. Do not confuse formalism with the use of formal tools, such as mathematics, that are employed in the
cited fields of study.
Chapter 2 Philosophical Context 55
Forward Thinking
An Observation
A quick glance around the development room reveals some interesting
graphical models drawn on paper or on the whiteboard. We also see peo-
ple pointing to and modifying these models as they engage in developing
tests or writing code. Figure 2-3 and Figure 2-4 are examples of two such
artifacts. Figure 2-3 is just a rectangle with some text, but it seems to be a
model of an object that one team is working on. Figure 2-4 consists of
some labeled boxes, lines, and arrows; judging from the conversation of
the development pair, it’s a model of object interactions that they are try-
ing to understand as a basis for writing a test.
behaviors or responsibilities.
(continued)
56 Object Thinking
in their individual heads with each other. Both provide a kind of external
memory for those involved in the development activities at hand. Neither
is worth keeping around once the task that prompted their creation is
completed.
4. Glass, Robert L. Software Creativity. Englewood Cliffs, NJ: Prentice Hall, 1995.
Chapter 2 Philosophical Context 57
development, the conflicts between “fuzzies” and “neats” in AI, and the classic
debates between devotees of Smalltalk and C++.
XP is the latest assertion of the view that people matter. XP is the latest chal-
lenger to the dominant (and hostile) computing and software engineering cul-
ture. XP is the latest attempt to assert that developers can do the highest-quality
work using purely aformal methods and tools. And XP is the latest victim of the
opprobrium of the formalists and the latest approach to be described as suitable
only for dealing with small, noncritical problems.
To the extent that objects (our present focus) are seen as an expression of
a hermeneutic point of view, they have been characterized as antirationalist, or
5. McCormick, Michael. “Programming Extremism.” Communications of the ACM 44(6), June 2001, 109–110.
58 Object Thinking
Postmodern Critiques
There is a controversy smoldering in the computer science
world at the intersection of two important topics: formal
methods and heuristics. The controversy, though it may
sound esoteric and theoretic, is actually at the heart of our
understanding of the future practice of software engineering.
6. Glass, Robert L. Software Creativity. Englewood Cliffs, NJ: Prentice-Hall PTR. 1995. (p. 42)
Chapter 2 Philosophical Context 59
7. Floyd, C., H. Zullighoven, R. Budde, and R. Keil-Slawik (eds.). Software Development and Reality
Construction. Springer-Verlag, 1992. Also Dittrich, Yvonne, Christiane Floyd, and Ralf Klischewski.
Social Thinking, Software Practice. MIT Press, 2002.
8. Coyne, Richard. Software Development in a Postmodern Age.
60 Object Thinking
Rejecting Mysticism
Although A Pattern Language: Towns, Buildings, Construction
(Oxford University Press, 1977), by Christopher Alexander, was published
before his The Timeless Way of Building (Oxford University Press, 1979),
the latter provides the philosophical foundation for the former. A Pattern
Language is cited by everyone in the patterns movement as an inspiration
for their own efforts, but The Timeless Way is seldom mentioned. Of
Chapter 2 Philosophical Context 61
for small teams, and for noncritical software. What the critics fail to realize, how-
ever, is that object thinking and agile thinking are not a means for solving soft-
ware problems; they are a means for creating better people and better teams of
people. Object thinking and XP will produce a culture (see note), not a technique;
they will give rise to better people capable of attacking any kind of problem and
able to develop systems on any level of complication and scale.
63
64 Object Thinking
In Rome, one’s first duty was to the group, clan, class, or faction
upon which one depended for status. Known as gravitas, this
meant sacrificing oneself for the good of the organization, and
giving up one’s individuality and identifying closely with the
group. In a Roman environment you go to work, the company
hands you your tools, and then it holds you and your mind
hostage until you sever your relationship with the organization.
You are not an individual: you are owned by the organization
body and mind, twenty-four hours a day. There are substantial
rewards for this, however. The organization provides you with
security, money, and power.
Cultures will usually have an origin myth, various heroes and heroines, and
stories about great deeds and important artifacts, as well as a set of core beliefs
and values. All of these are evident in the object culture and someday will be cap-
tured in a definitive ethnography. It is not my intent to elaborate that culture here,
merely to draw the reader’s attention to the fact that such a culture exists.
Being aware of object culture is valuable for object thinkers in four ways.
First, it provides insight into the dynamics of interaction (or lack of it) between
objectivists and traditionalists. Often the only way to understand the mutual
miscommunications and the emotional antipathy of the two groups comes from
understanding the underlying cultural conflict.
Second, and most important, it reminds the aspiring object thinker that
he or she is engaged in a process of enculturation, a much more involved
endeavor than learning a few new ideas and adopting a couple of alternative
practices. Most of the material in the remainder of this book cannot be fully
understood without relating it to object culture in all its aspects.
Third, it suggests a way to know you have mastered object thinking. When
all of your actions, in familiar and in novel circumstances, reflect “the right thing”
without the intervention of conscious thought, you are an object thinker.
66 Object Thinking
Fourth, it reminds the object thinker that culture is not an individual thing;
it is rooted in community. To change a culture, you must change individuals
and the way that individuals interact and make commitments to one another.
Culture is shared.
Subsequent chapters will deal with object thinking specifics, all of which
are intimately related to a set of first principles, or presuppositions reflective of
the object culture as a whole. The four principles introduced here are frequently
stated, stated in a manner that implies that the value of the principle is obvious.
Just as a member of any culture makes assertions that are indeed obvious—to
any other member of that culture.
Four Presuppositions
To those already part of the object culture, the following statements are obvious
(“they go without saying”) and obviously necessary as prerequisites to object
thinking:
■ Everything is an object.
■ Simulation of a problem domain drives object discovery and definition.
■ Objects must be composable.
■ Distributed cooperation and communication must replace hierarchi-
cal centralized control as an organizational paradigm.
For those just joining the object culture, each of these key points will need
to be developed and explained. For those opposed to the object culture, these
same presuppositions will be major points of contention.
Listing One—Pascal
program frequency;
const
size 80;
var
s: string[size];
i: integer;
c: character;
f: array[1..26] of integer;
k: integer;
begin
writeln('enter line');
readln(s);
for i := 1 to 26 do f[i] := 0;
for i := 1 to size do
begin
c := asLowerCase(s[i]);
if isLetter(c) then
begin
k := ord(c) – ord('a') + 1;
f[k] := f[k] + 1
end
end;
for i := 1 to 26 do
write(f[i], ' ')
end.
innate abilities of objects, including data objects (the string entered by the user
and character objects), resulting in a program significantly reduced in size and
complexity, as illustrated in Listing Three—Appropriate Smalltalk.
2. Taylor, David. Business Engineering with Object Technology. John Wiley & Sons, 1995.
3. Jacobson, Ivar. The Object Advantage: Business Process Reengineering with Object Technology. ACM
Press. Reading, MA: Addison-Wesley. 1994.
Chapter 3 From Philosophy to Culture 71
■ Provides information
■ Indicates a decision
■ Provides confirmation
■ Makes a selection
Proper decomposition has been seen as the critical factor in design from very
early times. This quotation from Plato (which you might recall from Chapter 1) is
illustrative.
The Taoist butcher used but a single knife, without the need to
sharpen it, during his entire career of many years. When asked
how he accomplished this feat, he paused, then answered, “I
simply cut where the meat isn’t.”
4. Alexander, Christopher. Notes on the Synthesis of Form. Harvard University Press, 1970.
Chapter 3 From Philosophy to Culture 73
According to this traditional story, even meat has natural disjunctions that
can be discerned by the trained eye. Of course, a Taoist butcher is like the Zen
master who can slice a moving fly in half with a judicious and elegant flick of
a long sword. Attaining great skill at decomposition will require training and
good thinking habits. It will also require the correct knife.
Decomposition is accomplished by applying abstraction—the “knife” used
to carve our domain into discrete objects. Abstraction requires selecting and
focusing on a particular aspect of a complex thing. Variations in that aspect are
then used as the criteria for differentiation of one thing from another. Tradi-
tional computer scientists and software engineers have used data (attributes) or
functions (algorithms) to decompose complex domains into modules that could
be combined to create software applications. This parallels Edsger Wybe Dijkstra’s
notion that “a computer program equals data structures plus algorithms.”
(continued)
74 Object Thinking
The fact that a computer program consists of data and functions does not
mean that the nonsoftware world is so composed. Using either data or function
as our abstraction knife is exactly the imposition of artificial criteria on the real
world—with the predictable result of “bad carving.” The use of neither data nor
function as your decomposition abstraction leads to the discovery of natural
joints. David Parnas pointed this out in his famous paper “On Decomposition.”
Parnas, like Plato, suggests that you should decompose a complex thing along
naturally occurring lines, what Parnas calls “design decisions.”
Both data and function are poor choices for being a decomposition tool.
Parnas provided several reasons for rejecting function. Among them are the
following:
(continued)
5. Yourdon, Edward, and Peter Coad. Object Oriented Analysis. Yourdon Press. Englewood Cliffs, NJ:
Prentice Hall, 1990.
76 Object Thinking
that all systems have a canonical form. His book Object Oriented Design includes
a diagram captioned, “Canonical Form of Complex Systems,” which captures both
classification and composition hierarchies and the relationship that should exist
between the two.
Classification requires differentiation, some grounds for deciding that one
thing is different from another. The differentiation grounds should reflect natural
ways of thought, as do classification and composition. So how do we differentiate
things in the natural world?
Consider a tabby and a tiger. What differentiates a tiger from a tabby? Why
do we have separate names for them? Because one is likely to do us harm if
given the chance, and the other provides companionship (albeit somewhat
fickle). Each has at least one expected behavior that differentiates it from the
other. It is this behavior that causes us to make the distinction.
Some (people who still believe in data, for example) would argue that tab-
bies and tigers are differentiated because they have different attributes. But this is
not really the case. Both have eye color, number of feet, tail length, body mark-
ings, and so on. The values of those attributes are quite different—especially
length of claw and body weight—but the attribute set remains relatively constant.
Behavior is the key to finding the natural joints in the real world. This
means, fortunately, that most of our work has already been done for us. Soft-
ware developers simply must listen to domain experts. If the domain expert has
at hand a name (noun) for something, there is a good chance that that some-
thing is a viable, naturally carved, object.
Note Listening to the domain expert and jotting down nouns cap-
tures the essence of finding a natural decomposition. A full and shared
domain understanding requires the negotiation of a domain language,
a term used by Eric Evans in his forthcoming book Domain-Driven
Design: Tackling Complexity in the Heart of Software.
decomposition into objects mirrors that of the user and the natural structure of
that domain should we begin to worry about how we are going to employ that
understanding to create software artifacts. (Our understanding may come one
story at a time, à la XP.)
■ The purpose and capabilities of the object are clearly stated (from
the perspective of the domain and potential users of the object), and
my decision as to whether the object will suit my purposes should be
based entirely on that statement.
■ Language common to the domain (accounting, inventory, machine
control, and so on) will be used to describe the object’s capabilities.
■ The capabilities of an object do not vary as a function of the context in
which it is used. Objects are defined at the level of the domain. This
does not eliminate the possible need for objects that are specialized to
a given context; it merely restricts redefinition of that same object when
Chapter 3 From Philosophy to Culture 79
Forward Thinking
A Problem of Reuse
In “Forward Thinking: Metaphor and Initial Stories,” which appeared in
Chapter 2, it was noted that two stories dealt with dispensing (change and
product) and might involve the same objects. Further discussion of dis-
pensing revealed three variations of a story involving some kind of
dispense action: dispense a measured volume of liquid, dispense a product,
and dispense change due the customer.
It would be nice if we had a single class, Dispenser, that could be
used in all three stories. This would mean that Dispenser would have to be
a composable object, able to be reused in different contexts without mod-
ification of its essential nature.
(continued)
6. The exception occurs when a method is declared high in the hierarchy with the explicit intent that all
subclasses provide their own unique implementation of that method and when the details of how are
idiosyncratic but irrelevant from the perspective of a user of that object.
80 Object Thinking
Yes, I know you would never write code this ugly and that the sec-
ond example will not really work, but code is not the issue here; refactor-
ing is. After some discussion, the teams decided that the dispenser object
was really just a façade for some mechanism that did the actual work of
dispensing: a valve that opened for a period of time, a motor that ran for
a period of time, or a push bar that kicked an item out of the dispenser
storage area. It was also decided that the quantity to be dispensed should
be supplied to the dispenser rather than calculated by the dispenser.
These decisions simplified the method dramatically. In all cases, the
pseudocode would look something like this:
For 1 to quantityToBeDispensed
DispensingMechanism dispense.
End-loop.
Chapter 3 From Philosophy to Culture 81
7. Page-Jones, Meillor. The Practical Guide to Structured Systems Design. Yourdon Press Computing
Series. Englewood Cliffs, NJ: Prentice-Hall, Inc.1988.
82 Object Thinking
distributed. The traffic signal controls itself and notifies (by broadcasting as a
different color) others of the fact that it has changed state. Other objects, vehi-
cles, notice this event and take whatever action they deem appropriate accord-
ing to their own needs and self-knowledge.
Master Control
Module
Note But what about intersections with turn arrows that appear only
when needed? Who is in control then? No one. Sensors are waiting to
detect the “I am here” event from vehicles. The traffic signal is waiting
for the sensor to detect that event and send it a message: “Please add
turn arrow state.” It adds the state to its collection of states and pro-
ceeds as before. The sensor sent the message to the traffic signal
only because the traffic signal had previously asked it to—registered
to be notified of the “vehicle present” event. Traffic management is a
purely emergent phenomenon arising from the independent and
autonomous actions of a collectivity of simple objects—no controller
needed. If you have a large collection of traffic signals and you want
them to act in a coordinated fashion, will you need to introduce control-
lers? No. You might need to create additional objects capable of
obtaining information that individual traffic signals can use to modify
themselves (analogous to the sensor used to detect vehicles in a turn
lane). You might want to use collection objects so that you can conve-
niently communicate with a group of signals. You might need to make
a signal aware of its neighbors, expanding the individual capabilities of
a traffic signal object. You will never need to introduce a “controller.”
Chapter 3 From Philosophy to Culture 83
Few would argue with these axioms and principles, although they would
certainly argue about the appropriate means for realizing them. Object thinkers
strive to achieve the goals implied by these axioms and principles as much as
8. Witt, Bernard I., F. Terry Baker, and Everett W. Merrit. Software Architecture and Design: Principles,
Models, and Methods. Van Nostrand Reinhold, 1994.
84 Object Thinking
any other software developer and believe that objects provide the conceptual
vehicle most likely to succeed.
For example, the separation-of-concerns axiom and the principle of mod-
ularity mandate the decomposition of large problems into smaller ones, each of
which can be solved by a specialist. An object is a paradigmatic specialist. Large
problems (requiring a number of objects, working in concert to resolve
the problem) are decomposed into smaller problems that a smaller community
of objects can solve, and those into problems that an individual object can deal
with. At the same time, each object addresses the principles of intellectual con-
trol (individual objects are simple and easy to understand) and the principle of
conceptual integrity (there should be a small number of classes). Properly con-
ceived, an object is a natural unit of composition as well. An object should
reflect natural, preexisting decomposition (“along natural joints”) of a large-
scale domain into units already familiar to experts in that domain. Conceived in
this fashion, an object clearly satisfies the principle of intellectual control.
Objects will also satisfy the principle of conceptual integrity because there will
be a limited number of classes of objects from which everything in the domain
(the world) will be constructed. In Chapter 4, “Metaphor: Bridge to the Unfa-
miliar,” an argument will be presented suggesting that the total number of
objects required to build anything is around 1000.
Objects are designed so that their internal structure and implementation
means are hidden—encapsulated—in order to satisfy the axiom of transforma-
tion and the principle of portable designs.
The principle of malleable designs has been the hardest one for software to
realize: only a small portion of existing software is flexible and adaptable enough
to satisfy this principle. In the context of object thinking, malleability is a key moti-
vating factor. Object thinkers value designs that yield flexibility, composability, and
accurate reflection of the domain, not machine efficiency; not even reusability,
although reusability is little more than cross-context malleability.
In fact, it might be said that for object thinkers, all the other axioms and
principles provide the means for achieving malleability and that malleability is
the means whereby the highest-quality software, reflective of real needs in the
problem domain, can be developed and adapted as rapidly as required by
changes in the domain. Agile developers and lean developers9 value malleabil-
ity as highly as object thinkers. XP software systems emerge from software that
satisfies the demands of a single story, an impossibility unless it is easy to refac-
tor, adapt, and evolve each piece of software (each object); impossible unless
each bit of software is malleable.
9. Poppendieck, Mary, and Tom Poppendieck. Lean Software Development: An Agile Toolkit for Software
Development Managers. Addison-Wesley. 2003.
Chapter 3 From Philosophy to Culture 85
Fred Brooks wrote one of the most famous papers in software develop-
ment, “No Silver Bullet: Essence and Accidents of Software Engineering.”10 In
that paper, he identified a number of things that made software development
difficult and separated them into two categories, accidental and essential.
Accidental difficulties arise from inadequacies in our tools and methods and
are solvable by improvements in those areas. Essential difficulties are intrinsic to the
nature of software and are not amenable to any easy solution. The title of Brooks’s
paper refers to the “silver bullet” required to slay a werewolf—making the meta-
phorical assertion that software is like a werewolf, difficult to deal with. Software,
unlike a werewolf, cannot be “killed” (solved) by the equivalent of a silver bullet.
Brooks suggests four essential difficulties:
■ Complexity Software is more complex, consisting of more unlike
parts connected in myriads of ways, than any other system designed
or engineered by human beings.
■ Conformity Software must conform to the world rather than the
other way around.
■ Changeability A corollary of conformity: when the world changes,
the software must change as well, and the world changes frequently.
■ Invisibility We have no visualization of software, especially exe-
cuting programs, that we can use as a guide for our thinking.
He also investigates potential silver bullets (high-level languages, time
sharing, AI, and so on) and finds all of them wanting. Object-oriented pro-
gramming is considered a silver bullet and dismissed as addressing accidental
problems only.
Although I would agree with Brooks in saying that object technology—
languages, methods, class hierarchies, and so on—addresses only accidental
problems, object thinking does address essential difficulties, and it does so with
some promise. Objects can conform to the world because their design is pred-
icated on that world. Objects are malleable, resolving the changeability issue.
Objects provide a way to deal with the complexity issue and even allow for the
emergence of solutions to complex problems not amenable to formal analysis.
The metaphors presented in Chapter 4 provide the tools for visualization to
guide our thinking.
Object thinking suggests we deal with software complexity in a manner
analogous to the ways humans already deal with real-world complexity—using
behavior-based classification and modularization. Object thinking is focused
on the best means for dealing with conformity and changeability issues—the
Forward Thinking
Communication and Rules
Because the UVM might be dispensing food items and because we want
the customer experience to be always positive, we want to ensure that no
spoiled products are vended. This leads to a story—Expire: no product is
sold after its expiration date has been reached.
The development team discusses (and codes) various ways this
might be accomplished. Through a combination of refactoring efforts and
arguments, it is decided that the expiration problem will best be solved by
a group of objects communicating with one another, with those commu-
nications being triggered by events.
Whenever a product is placed in the vending machine, it asks itself
for its expiration date. It then asks the SystemClockCalendar to add an
eventRegistration (consisting of the productID and the “die” message) for
the event generated whenever a new day is recognized by the System-
ClockCalendar. (Programmers, even extreme programmers, often have a
rather grim sense of humor; hence the “die” message to effect product
expiration.) At the same time, the Dispenser object asks the new product
to accept a registration for the “I’m dead” event that the product will gen-
erate when it receives the “die” message from its own event registration that
was placed with the SystemClockCalendar. The dispenser’s eventRegistration
with the product will cause the message “disableYourself” to be sent to the
dispenser, who will, indeed, “disable” itself (with the accompanying event
that other objects—such as the menu or the dispenser collection—might
register for).
Breaking up a potentially complex decision-making and cascading-
effects problem into pieces that can be distributed among many objects
while at the same time relying on simple, reusable components such as an
eventRegistration and a Dispatcher greatly reduces the complexity that
worries Brooks. It also accommodates the conformity and changeability
requirements imposed on software: event registrations can be added or
Chapter 3 From Philosophy to Culture 87
Cooperating Cultures
Arguing for the existence of an object paradigm or object culture is not and
should not be taken as an absolute rejection of traditional computer science
and software engineering11. It would be foolhardy to suggest that nothing of
value has resulted from the last fifty years of theory and practice.
11. The ideas in this section were first published in a short editorial by the author in Communications
of the ACM, 1997.
88 Object Thinking
Claiming that there are clear criteria for determining whether software is
object oriented is not the same as saying all software should be object oriented.
Expecting a device driver implemented with 100 lines of assembly language
to reflect full object thinking is probably pointless. It’s possible that Internet
search engines must be implemented using “database thinking” rather than object
thinking—at least for the immediate present. Different problems do require dif-
ferent solutions. The vast majority of problems that professional developers are
paid to deliver, however, almost certainly require object solutions.
Traditional approaches to software—and the formalist philosophy behind
them—are quite possibly the best approach if you are working close to the
machine—that is, you are working with device drivers or embedded software.
Specific modules in business applications are appropriately designed with more
formalism than most. One example is the module that calculates the balance of
my bank account. A neural network, on the other hand, might be more herme-
neutic and objectlike, in part because precision and accuracy are not expected
of that kind of system.
Traditional methods, however, do not seem to scale. Nor do they seem
appropriate for many of the kinds of systems being developed 50 years after the
first computer application programs were delivered. Consider the simple graph
in Figure 3-2.
Natural -
Sociocultural
World
Object
Paradigm
Comprehension
Implementation
Computer
Science
Paradigm
Deterministic
World
Object philosophy generates a different view of the world, one that is strange to
most and especially to developers trained in conventional methods and ideas.
This raises the question of how best to assist developers to understand the new
world of objects. In other disciplines, metaphor is frequently used to help those
new to an area of study comprehend its fundamental concepts.
Consider the Bohr model of an atom, as one example. Physicists and
chemists need to explain atomic structure to lay people and to new students.
One common way to do so is to employ Bohr’s metaphoric model that says an
91
92 Object Thinking
atom is like a tiny solar system—a nucleus (sun) surrounded by orbiting electrons
(planets). This metaphor is technically inaccurate, of course, but it remains a useful
tool for introducing atomic concepts.
Unsurprisingly, metaphors have also been used to convey object concepts.
One of the earliest, coined by Brad Cox, is the software integrated circuit (IC).
This metaphor juxtaposes a desirable trait for software objects with hardware
components, that is, the ability to use them as standardized and interchangeable
parts to “mass-produce” larger constructs. It’s possible, for example, to shop at a
number of electronics stores, buy standard components from a variety of manu-
facturers, and use those components to assemble a working personal computer.
Construction of software in a similar manner is one goal of object orientation;
hence the applicability of the metaphor.
Forward Thinking
A Vignette
Roger and Suroor are working on the “accumulate money” story, the user
story about how the vending machine accepts coins and currency and
reports back a total. They have test cases based on random selection from
among all the possible denominations of coins and paper money from all
three target currencies (euros, yen, and dollars) and are starting to code
the Accumulator class.
“I guess we will need a method to determine what kind of currency we
have and what its value is,” suggests Roger, “and one to convert the curren-
cies into some kind of common value—all dollars, or yen, or euros. A method
to report the total amount in the accumulator and one to actually add each
instance of inserted money to the current accumulation,” he continued.
“Don’t forget some kind of reset-to-zero method,” added Suroor.
“Two of these methods are really easy.” Suroor is talking while typing
code for two methods: reset −total = 0; and total, which just returns the
amount in the instance variable named total.
“Determining the kind and value of the currency looks like it might
be complicated,” says Roger, reaching for the keyboard, “some kind of
case statement probably.”
1. Beck, Kent. Test Driven Development by Example. Boston Addison-Wesley, 2003. ISBN 0-321-14653-0.
Chapter 4 Metaphor: Bridge to the Unfamiliar 95
its implications suggests ways to discover, design, and build truly reusable and
composable objects. This alone would make the metaphor extremely valuable.
Given that developers have pursued the dream of reusable code libraries from
the very advent of computing—with very limited success—a way to actually
accomplish that goal would be invaluable.
Two other items suggested by the metaphor are related. Objects should be
simple, and there should be relatively few of them. There are fewer than 10 basic
Lego brick types. (Kits contain additional parts, each of which is highly specialized,
such as tiny human figures and motors, but these cannot be considered true Legos.)
There are only 134 elements and only six quanta. The vast majority of houses in this
country are built with fewer than 10 standard sizes of dimension lumber. In all of
those cases as well, the base elements are simple and highly specialized.
This suggests that there are a similarly small number of objects from which
we can construct any type of software needed to model any domain or organi-
zation. (See the sidebar “How Many Objects?”)
Chapter 4 Metaphor: Bridge to the Unfamiliar 101
It’s frequently convenient to build a large construct from small, but not the
smallest possible, components. It’s easier to build living things with hydrocar-
bon molecules than directly with individual atoms. It’s easier to build a roof
with a truss made of standard-dimension lumber and gang nails than a board
and a nail at a time. Intermediate constructs, such as trusses used to build
houses, are components. The number of components will be much larger than
the number of objects from which those components are constructed. More-
over, they will likely reflect stylistic differences reflective of the designers and
potential users of such components.
The last item suggested by the metaphor deals with process. Watching a
child work with the bricks reveals a process of discovery filled with a certain
amount of trial and error and supportive of rapid change as prototypes fail to
meet satisfaction criteria and so are taken apart and reassembled in another
attempt to reach the envisaged goal.
XP development closely resembles playing with Lego bricks in the sense
that it too allows discovery and emergent solutions, tolerates and leverages mis-
takes, encourages taking things apart and reassembling them into more elegant
solutions (refactoring), and relies heavily on feedback as to the extent to which
the current assembly meets user expectations.
Both XP and the metaphor suggest a need for a development environment
that supports this kind of development process model. Smalltalk and visual pro-
gramming environments, such as Visual Studio, provide examples of development
environments and tools that are superior to, in this regard, compile-link-test envi-
ronments such as C++ (even Visual C++ with incremental compilation). This notion
would seem to be borne out in experience. It typically takes about half as long to
develop an application with Smalltalk as with C++, given equivalent levels of skill
in the developers, even with current incremental compilers. Even advocates of lan-
guages such as C++ will tend to concede the speed-of-development issue and
focus instead on characteristics-of-product issues such as speed of execution.
If objects are similar to persons, they are limited in some of the same ways
that human persons are limited. For example, they need to know certain things to
complete an assigned task. When the book was young and still being composed
(playing the role of manuscript), it might have been asked to add a page to its col-
lection of pages. To do this, it would have needed to know the page to be added.
Like people, software objects are specialists. They are also lazy. A conse-
quence of both these facts is the distribution of work across a group of objects.
Take the job of adding a sentence to a page in a book. Granted, it might be
quite proper to ask the book, “Please replace the sentence on page 58 with the
following.” (The book object is kind of a spokesperson for all the objects that
make up the book.) It would be quite improper, however, to expect the book
itself to do the work assigned. If the book were to do that kind of work, it
would have to know everything relevant about each page and page type that it
might contain and how making a simple change might alter the appearance and
the abilities of the page object. Plus the page might be offended if the book
attempted to meddle with its internals.
The task is too hard (lazy object) and not the book’s job (specialist object),
so it delegates—merely passes to the page object named #58 the requested
change. It’s the page object’s responsibility to carry out the task. And it too
might delegate any part of it that is hard—to a string object perhaps.
Following these patterns, we let the book and the page do what each
does best and what is appropriate for each. If we need a service that requires a
104 Object Thinking
contribution from more than one object, either we assume responsibility for
asking the objects for their individual contributions and assembling those
results in a way that suits our purpose or we send the request to whichever
object is acting as spokesperson for the group and allow it to delegate tasks and
assemble responses in order to reply to our request.
The person metaphor guides our decomposition and our assignment of
responsibilities to software objects that always reflect the demands of the
domain, not their eventual implementation. Our software object should simu-
late the services provided by our real-world object, both of which we meta-
phorically regard as people. Even though it’s true that we must be more precise
in specifying our software object, it’s critically important that we continue to use
the real world and not the computer (implementation) world as the foundation
for our conceptualization of the software object.
Forward Thinking
Hey, Coach!
“Hey, coach,” Lori waved to Ron, who was playing the role of coach for
the teams today, “could you grab Hector [their on-site customer] and
mediate a quick conversation about this ‘make selection’ story?”
“Sure thing, be right over.”
Ron and Hector saunter up to Lori and Sally’s work area. “What’s up?”
“Sally and I have been working on this ‘make selection’ story, and we
think it might need to be broken up—refactored. Either that or we are mis-
thinking our objects. The story reads, ‘Allow the customer to make a selec-
tion from the available products, making sure that no expired products are
sold and that sufficient funds are available to pay for the product selected.’”
“We visualize this story going like this: 1) a selection object is created
when a customer inserts money or a debit/credit card; 2) the selection object
then monitors the console buttons for selection input; 3) when buttons are
pushed, the selection object puts them together as a kind of key or index value
and then asks the dispenser collection whether it has a dispenser matching
that key and whether it is operational (its product has not expired and it is not
empty); 4) the selection then asks the dispenser for the price of the product
and the accumulator for the amount of money available; 5) if we get all yeses,
we tell the dispenser to do its thing and give the customer the product. This
seems to capture the story, but it will involve a lot of potential error-handling
methods—in case the dispenser doesn’t exist or there are other problems.”
Hector looked a bit puzzled. “That seems to capture the story all right.
I don’t see any problem, but you are uncomfortable. Can you tell me why?”
Chapter 4 Metaphor: Bridge to the Unfamiliar 105
“It just seems too complicated. The way we envisage building and
testing this, it isn’t simple enough.”
Ron said, “I think you have the story right, but you might want to
consider involving some different objects, and you might want to assume
that some of the things you are trying to do in this story are actually done
at a different point in time. Check me on this, Hector, to make sure that we
don’t invalidate your story.
“Your selection object is a good idea, but let’s simplify it. It will be
what Rebecca Wirfs-Brock and Alan McKean would call a structurer ste-
reotype object—that is, it will exist primarily to maintain a structural rela-
tionship: in this case, the parts of a selection. Some selections will have
only one part, as with the soda machine: a selection is just a numbered
button. For the candy machine, the parts are a letter and an integer. Your
idea of having it constitute itself in response to a money-inserted event
and button-pressed events is a good one.
“But we will introduce another object—a menu object. This will be a
collection kind of object, and it will represent, or proxy, the dispenser col-
lection. Visualize it like a two-dimensional table: column 1 is a key, and
column 2 is a variable.
“You remember variables? An object that contains an object reference
and a message to be sent to that object in order to change from an
unknown to a known value?”
“Yes.” Everyone agreed that they remembered what a variable object was.
“OK, now—assume that the menu is constantly updated whenever a
dispenser is activated or deactivated and that, at the time when a selection is
made, all you have to do is ask the menu whether it contains an entry at the
key value that matches your selection object. If it does not, a message is sent
to a userMessage object, which prompts the user for a different selection.
“If the selection is included in the menu, we involve another
object—a dispenseRule object. This is probably a singleton object, and it
lives in an instance variable of the vendingMachine object. Oh, and by the
way, your selection probably lives in another instance variable of the
vendingMachine while it is alive. The dispenseRule has registered with
the currentSelection variable (that is where your selection will live) to be
notified if the object-in-residence (your selection object again) generates a
selectionMade event. This is what will happen if the menu object confirms
that you are a valid selection.
(continued)
106 Object Thinking
“The dispense rule has two variables: one that sends a price message
to the product at the front of the dispenser, or maybe to the dispenser
itself, and a second one that sends the total message to the accumulator. It
also has one operator, and that is less-than (or greater-than, depending on
how you actually write your code to relate the two variables), and it eval-
uates to a Boolean true or false.
“If dispenseRule evaluates to true, the product is dispensed. If not,
another userMessage object is told to engage the customer in a dialog to
resolve the situation.
“Most of what I am suggesting is just moving responsibilities around
among objects—to simplify things for all concerned. But it does require
another user story—if Hector is agreeable—called ‘update menu.’ That
story will be executed whenever a dispenser changes its state.”
“No problem,” Hector says. “In fact, some kind of story of that type
would probably have been written anyway. The boss and I were discuss-
ing how we can build machines that contain different products in each
dispenser and have LEDs or icons or something appear on the face of the
vending machine to cue the customer about what is available inside—
your menu, in essence. I’ll write up the story, and we can bring it up at the
next game-planning session.”
“That help you two?” Ron asked Lori and Sally.
“Absolutely. We’ll have this done in no time with those simplifica-
tions. We’ll just stub in the menu behaviors for now until that story and
object are ready. Thanks, Ron, thanks, Hector.”
We have said that objects have access to all of the resources necessary to
do their jobs. In the case of a software object, this means that each object is
assumed to have access to all of the resources of an arbitrarily complex com-
puter system if necessary. This is one reason that Alan Kay calls objects “intel-
ligent virtual computers.” Because we are conceptualizing each of our objects
as possessing its own computer (virtual computer or thread), we have the foun-
dation for concurrent or parallel processing systems. Objects, like the people
we metaphorically equate them to, can work independently and concurrently
on large-scale tasks, requiring only general coordination. When we ask an
object collective to perform a task, it’s important that we avoid micromanage-
ment by imposing explicit control structures on those objects. You don’t like to
work for a boss who doesn’t trust you and allow you to do your job, so why
should your software objects put up with similar abuse?
Chapter 4 Metaphor: Bridge to the Unfamiliar 107
The object-as-person metaphor, and the parables you can tell using the meta-
phor, are simple, easy-to-remember proxies for heuristics and axioms of good design.
familiar manner, and if they are unable to interact with the other objects in the
real world in which they are to operate, they will fail. Software development is
reality construction (or reality reconstruction), just as Christiane Floyd and her
colleagues have asserted. And the theater metaphor helps us accomplish our
task by reminding us “that all the world is a stage” and that our artifacts are but
actors on that stage. (Chapter 7 of the Poppendiecks’ book on lean software
development explores this idea from a slightly different perspective.)
Sometimes the script followed by our object actors will be fixed. In soft-
ware, most batch processes would be considered to have a fixed script. But
more and more software needs a mix of fixed and extemporaneous scripts.
Extemporaneous scripts are those that are highly interactive and in which the
conversation is not predictable in advance.
Visual programming environments provide an illustration of this meta-
phor. Object (cast) selection is accomplished by dragging iconic representations
from a catalog to a workspace. Links between or among objects are established
by drawing lines to connect them with one another. Each link defines a circum-
stance in which one object communicates with another. (Events and messages
are two types of communication.) The collection of links established in the
workspace is the script for that group of objects.
The play (theatrical production) metaphor can be extended a bit further.
Plays come in many sizes, and the complexity of the script varies accordingly.
A one-person play is relatively simple to produce (but requires an exceptionally
talented actor), while a Cecil B. DeMille epic with a “cast of thousands” is con-
siderably harder to organize. The complexity of object-oriented application
software is in the scripting, not in the objects.
110 Object Thinking
Our tools, as application software developers, for dealing with this com-
plexity are still quite limited. One need only reflect on the rapid accumulation
of visual clutter (overlapping lines, obscure icons) in a visual programming
workspace to see how limited our ability is to describe large-scale interactive
scripts. As with any other complicated task, we will attempt to solve this prob-
lem by decomposing our play script into act and scene scripts.
Four additional aspects of this metaphor deserve some discussion before
we move on. First, although we classify plays as being of various types depend-
ing on their complexity and scope, all theater is essentially the same, a group of
actors focused on accomplishing a particular objective, coordinated by a script.
With software, we distinguish between objects, components, applications, sub-
systems, and systems for our convenience. Close examination reveals that in
each case we have a number of objects focused on accomplishing a small list of
tasks while constrained by a guiding script. This tells us that we need to apply
the same principles of object philosophy whether we are constructing the most
Chapter 4 Metaphor: Bridge to the Unfamiliar 111
specific class or a system with wide scope. We do not suddenly revert to old
habits just because the job is larger.
Second, replacing actors of similar talent and skill set should not require a
rewrite of the script for a play. Substituting objects capable of the same behavior
should not require a redesign of the software. We should be able, in fact, to
nuance or dramatically change the overall behavior of our software simply by
changing players. A drama can be turned into a comedy simply by replacing
dramatic actors with comedic actors. The latter receive the same cues and
deliver the same basic behavior (say the same lines) but use their innate abili-
ties to interpret the cues and respond in very different ways. This point will
become important later, when we discuss application frameworks.
Third, when the curtain rises, exceptional things (not planned for in the
script) will occur. It is up to the actors (objects) and their abilities, for the sake of
cooperative peer communication, to recover and keep things going forward.
Actors cue one another and do not have to rely on the director, nor does the
director need the complexity that would allow her to anticipate and control every
possible variation in a performance arising from unanticipated events.
Fourth, just as plays are categorized by genre, it’s appropriate to extend
the theater metaphor to software and classify systems into genres, based on
typical forms of organization, or architectures. An architecture is a patterned
way of organizing a set of actors, as is a genre. We generate expectations and
constraints that will apply to our actors based on the genre of the performance,
or the type of architecture. Architectures also provide general solutions or
frameworks that make it easier to conceptualize the organization of our cast.
Patterns (genres) provide “script templates” to which the designer adds detail
in order to construct the actual script used by an object collective to complete
its work.
These two counterexamples provide the basis for the metaphor that
objects are coordinated as if they were ants and that no object attempts to
assume the role of autocrat controlling the behavior of other objects.
Inheritance
Humans naturally aggregate similar things into sets (or classes). Another “natural”
kind of thinking is to create taxonomies—hierarchical relationships among
the sets. The most common example of this kind of thinking is Carolus Linnaeus’s
taxonomy of flora and fauna and the subsets of that taxonomy that are general
common knowledge. Fido is a dog (example of aggregation and the subsequent
identification of a set). The set Dog is a subset of Canine, which is a subset of
Mammal, which is a subset of Animal. (The example taxonomy isn’t complete,
nor is it intended to be accurate—merely illustrative.) We could also say that a
dog is a kind of canine, which is a kind of mammal, which is a kind of animal.
Taxonomies are tree structures.
Another kind of tree structure—one that actually employs the term—is a
genealogical chart, a family tree. Because both the taxonomy and the geneal-
ogy chart use the same structure, a hierarchical tree, they have become a kind
of conflated metaphor.
The terms parent and child, for example, are clearly appropriate for gene-
alogy but are somewhat suspect when applied in the context of a Linnaean
hierarchy. Nevertheless, it is common to speak of the superset/subset relation-
ship in terms of parents and children. A superclass is Parent, and a subclass is
Child. From here, it’s but a short step to talk about children “inheriting” from
parents.
At this point, the metaphor can be helpful or potentially misleading
depending on how it is used.
According to the presuppositions of the object paradigm, a child class is a
behavioral extension of the parent. A dog has all the behavior of a mammal
plus some additional behavior that’s specific to dogs. If we say that a dog inherits
the behaviors of a mammal and mean by that statement that a dog can be asked
to do anything that a mammal can do, we are using the metaphor properly.
Too often, however, the metaphor is used to assert that the child class
inherits the internals of the parent class, an allusion to the fact that biological
organisms inherit the DNA structures of their parents. This is a poor and poten-
tially misleading use of the metaphor.
Behavior is the abstraction that we use to differentiate among objects, and
it should be the only criterion that we use to establish our taxonomy. Using any
other criteria will make our taxonomy more complicated at a minimum and
erroneous at worst. In the real world, errors such as racism and sexism can be
seen as characteristic-based rather than behavior-based taxonomies—with the
obvious negative consequences.
In the context of software objects, creating taxonomies based on internal
structure (attributes or operations, for example) causes problems in numerous
Chapter 4 Metaphor: Bridge to the Unfamiliar 115
ways. One example is the need to create new classes of objects such as Customer
and CreditCustomer just because one has different characteristics in some con-
texts than in others (a credit rating, perhaps). It can also lead to an apparent need
for multiple lines of “inheritance” when an object has characteristics that are part
of the structure of two or more potential parent objects.
The desire for a child class to inherit internals of its parent classes can be
better accommodated if we change the notion of inheritance from DNA to
assets. It has been noted that an object has access to whatever resources it
needs to fulfill its behavioral expectations. If we say that child classes have
access to the resources of their parents via inheritance, that is, by virtue of the
parent-child relationship, our use of inheritance remains consistent with the
object paradigm.
Responsibility
We know an object by what it does, by what services it can provide. That is to
say, we know objects by their behaviors. We are not interested, of course, in
just any old behavior. We have specific expectations of our objects and are sur-
prised if they deviate from those expectations. Because we expect objects to
exhibit certain specific behaviors, we tend to hold them accountable for those
behaviors. (We experience negative reactions such as disappointment and even
anger if the objects “let us down.”) We expect them to “perform as advertised.”
Our thinking about the abilities of objects shifts from simple awareness of
behavioral possibilities to expectations of service, of responsibilities. The capa-
bility is unchanged, but our perception of that capability is different enough to
merit the use of responsibility as a label.
If an object states that it is capable of providing a given service, it should
perform that service in all circumstances, and the results should be consistent.
If an integer object says, “I can add myself to any integer you provide and
return to you the resulting integer,” it would be very irresponsible if sometimes
it returned a floating-point number or, worse, if it were an integer that was
other than the one representing the summing process.
Responsibility implies that an object must assume control of itself. It must
be capable of assuming responsibility for its own maintenance, for notifying
others of any interesting and shareable state changes that it might experience
and that other objects might need to be aware of, for making sure it’s persistent
when it needs to be, for protecting its own integrity, and for responding appro-
priately to requests for service from multiple clients. Just as it’s improper for one
object to assume a role as controller or manipulator of another, it’s improper for
an object to fail to assume responsibilities that make the need for external
control unnecessary.
116 Object Thinking
117
118 Object Thinking
Forward Thinking
It’s Not a Code “Smell,” But …
“Every time I look at this code, it seems strange—but not strange,” Jon
comments to Samantha. “It’s pretty ordinary for the most part, but I have
this constant nagging feeling that something is different—not wrong, just
different.”
“Not surprising,” replies Samantha. “This is probably your first real
object-oriented project as well as your first XP project.”
“What do you mean? I’ve been writing Java for several years; doesn’t
that count as OO?”
“Not necessarily, because what you code is dependent on how you
have thought about the problem space and how you have decomposed
that space into objects. Just using a particular language doesn’t mean you
build objects; only object thinking about decomposition assures that you
will build objects.”
“Huh?”
“Let me show you. Remember the ‘Serene Meditation’ story we
worked on last week?”
“Yeah, our customer has some imagination when he writes story
titles. ‘Serene Meditation: The machine goes into a power-save mode until
a potential customer triggers an induction field around the machine or
calls the machine’s published phone number. When its meditation is inter-
rupted, the machine lights up, its selection menu is presented, and the
money-accepting mechanisms are initiated.’”
“Yeah, he does, but when we first wrote the code for that story you
had two ‘controller’ objects, phone and inductionField, that tried to keep
track of the other components and send them wake-up messages. When I
pointed out the duplicated code, you quickly refactored into a single con-
troller, but then you had to include a case statement to notify different
objects depending on the actual source of the wake-up event. Only after
we talked about MVC and using event dispatchers and event registration
did we hit on the correct solution: let the machine, selectionMenu, coin-
Accepter, billAccepter, and cardAccepter objects register with the induction-
Field or phone object so that it’s notified if it detects the unique event it’s
looking for. When we wrote the code, it didn’t look radically different, but
the organization of the code to form the methods was different.
(continued)
Chapter 5 Vocabulary: Words to Think With 119
“And last week, we were working on the form object and had really
different ideas of what its methods should be?”
“Yeah, I had a whole bunch of methods, mostly setters and getters
for attributes. You had only three or four methods that you thought nec-
essary. Turns out I was thinking about attributes all wrong.”
“Not all wrong, and according to some object theorists not wrong at
all. When Coad and Yourdon published their first book on OO analysis,
they defined objects and attributes as if they were standard data entities.
Schlaer and Mellor, Rumbaugh, and a host of others did essentially the
same thing. UML, which you used a lot before coming here, allows greater
latitude in the definition of an attribute, but the base definition is still ‘a
named characteristic with a value.’ You were still thinking of attributes as
some characteristic of an object, the value of which the system had to
remember.
“So you were thinking of a form in terms of a lot of attributes: form-
Number, dateCreated, lastRevisionDate, title, and so on. I was defining a
form as an object that contained other objects, a collection, and an object
that could identify itself, display itself (with help from the objects it con-
tained), and describe itself.”
“Yeah, all the attributes I was listing ended up being inside a descrip-
tion object—another kind of collection, kind of like a dictionary.”
“So you see, it’s not the code that’s different—it’s the objects and the
distribution of methods across the set of objects that’s different.”
“And the vocabulary is different too. I have to keep reminding myself
that things such as functions and methods look essentially the same, but
they derive from very different ideas. A method reflects a behavior expected
in the domain, and a function reflects a unit of execution in the machine.”
“Got it! Now back to this ‘reorder product’ story.”
Essential Terms
The following terms have the greatest philosophical importance—they embody
most of the philosophy that makes the object difference.
Object
Objects are the fundamental units of understanding. We define the world (and
the world of software) in terms of objects. Everything is an object! An object is
anything capable of providing a limited set of useful services. Metaphorically,
an object is like a human agent or actor. We decompose the complex world
around us in terms of objects, and we assemble (compose) objects in various
ways so that they can perform useful tasks on our behalf.
Our understanding of an object is, and should be, based on that object’s
public appearance: its “family name” (class) and an “advertised list of services”
(protocol) that it is willing to provide. Every object has a “personal name,” which
is a unique identifier, and a “family name,” which identifies the set (class) of sim-
ilar objects to which the particular object belongs. Most often we speak of the
family (or class) name of the object. That name is descriptive of the object and
should convey a general sense of the kind of services it might be able to provide.
The set of advertised services usually takes the form of a list of syntactic phrases
that we can use to invoke each behavior. Separately documented is a list of
potential states that the object might be in. Not all object states are included in
this list, only those that the object wants to share and those of which other objects
need to be aware. Together these lists constitute our behavioral promise to the
world at large. We (speaking as an object) do not share with the world any notion
of our internal structure and certainly no sense of how we do what we do.
Every object has access to whatever knowledge is required to perform its
advertised services. This does not mean that the object contains that informa-
tion. Information can also be accessed by asking another object, supplied as
part of a request, or calculated upon demand.
Traditionally, software was conceived in terms of passive data and active
procedures. One of the more famous definitions of a program is “algorithms plus
data structures.” This is also called the pigeonhole approach to software—passive
bits of data sitting in boxes (such as those seen in a post office sorting room,
which are called pigeonholes) where procedures come to remove a bit of data,
transform or use it, and then put it back for the next procedure to access.
Because everything is an object, there is no data. One of the principal
ideas of traditional software approaches has disappeared. Everything, including
characters and integers, is an object responsible for providing specific services.
The elimination of passive data has important consequences for object design,
a topic that will be discussed in depth later in this chapter. The consequences
122 Object Thinking
manifest themselves at the level of design and are felt minimally at the level of
code. This should be reassuring to those (a vast majority) who are using typed
languages such as Java. When you actually write code and are compelled to
declare types for variables or use objects such as strings and characters and
numbers solely for their ability to represent data, you won’t be violating any
principles of object thinking. You will find that you have fewer objects repre-
senting passive data and are much more likely to create an abstract data type to
represent a data object instead of using constructs built into the language.
Therefore, the three popular graphic models of an object shown in Figure 5-1
are misleading and should not be relied upon. The donut model (what Ken Auer
calls the soccer ball model because the dividing lines resemble the seams of a soc-
cer ball) perpetuates the classic ideas of passive data and active procedures and
better describes a COBOL program than an object. The animated data entity
model also perpetuates the outdated separation of data and procedures and com-
pounds that error by focusing on the distribution of data items—attributes—across
a group of objects. Procedures are appended to the objects containing the distrib-
uted attributes. This data-driven approach to object modeling is quite popular but
is not consistent with object thinking.
Encapsulation
Barrier
Class Name
operationX
Attribute List
Attributes are
Data typically determined
operationY according to the rules of
Structure
data modeling
Operations List
Class Name
Responsiblity Collaborator
a short list of Occassionally the satisfaction
behaviors appears of a responsibility requires
here. services from another object -
short = ??? a collaborator. If so the class
name of the collaborator
appears here.
Another, and essential, way that objects differ from the modules at the
heart of traditional software decomposition is that an object represents some-
thing naturally occurring in the problem domain, while a module represents a
logical aggregation of elements appearing in the solution space. This is another
reason why the foregoing graphical depictions are misleading and should be
avoided. All three diagrams depict what is to be built instead of what is to
be modeled. Object discovery and specification must be domain driven!
Responsibility
Responsibility means a service that an object has agreed (or been assigned) to
perform. Objects are charged with performing specific tasks. Each task is a
responsibility. The term responsibility is used to aid us in discovering who (which
object) should be charged with a task without the need to think about the object’s
structure. (We should not know its structure.) Responsibilities are characterized
from the point of view of a potential client of a service. I ask, “Who would I rea-
sonably ask for this service?” and my answer determines which object becomes
responsible for satisfying that type of service request.
124 Object Thinking
it agrees to provide you with a string, the value of which you would recognize
as a unique identifier.
A more complex example would be an object, a product perhaps, that
agrees to provide you with its description. In response to your request, this time
the object gives you a description object. A description object can be thought of
as a collection of labels and associated values called a value holder (essentially
the same thing as a Dictionary in Smalltalk or a Map in Java). (See Figure 5-2.)
You then ask the description object for a particular value associated with a
specific label.
Figure 5-2 A value holder, a simple two-dimensional array with the con-
F05MQ02
tents of the first column restricted to labels and the contents of the second
restricted to data objects such as strings, numbers, dates, and characters.
1. In this example, the second number does assume a kind of passive role, being subsumed by the active
number doing the calculation. But either number could have been the active one, so the principle of
objects acting only on themselves is preserved.
126 Object Thinking
Event Dispatcher
the first column, whereas the second column is a queue of event registra-
tion requests.
[object message]
object is the name or identity of an object which is sent
the message when the event associated with the queue
is detected. An optional priority could be added to the
dyad if the event queue allowed priority dispatch
instead of first in first out.
Message
A message is a formal communication sent by one object to another requesting a
service. A message can be imperative, informational, or interrogatory in nature.
An imperative message directs an object to make some change to itself. No
response is expected or required. The object is assumed to have made the appro-
priate change. (It’s quite possible, of course, for an object to offer confirmation of
an imperative message by returning some specific kind of object, but care should
be taken that this capability not be misused to create controller objects.)
An informational message is similar to an imperative in the sense that no
response is expected. It differs from an imperative in that there is also no expec-
tation that the receiving object will do anything at all in response to the message.
An interrogatory message is any request for a service. The object always
returns an object (a typed value or a signal/interrupt in most popular program-
ming languages) that encapsulates (embodies) the result requested. The
returned object can be simple (a character or a string) or arbitrarily complex.
Messages frequently take the following form:
Receiver Selector (Arguments) ← returnedObject or Receiver.Selector
(Arguments):ReturnedObject.
where
■ Receiver identifies who is being sent the message. It might be a spe-
cific named object (the object Sara), a generic object (aPerson), or
the name of a place where an object resides (a variable). In the case
of a variable, the object in residence actually receives and responds
to the message.
■ Selector identifies the semantics of the message, the essence of the
request. Selectors can be simple symbols (such as the mathematical
operators, +, *, /, and so forth) or descriptive phrases (nextObject-
InLinePlease).
■ (Arguments) are objects sent along with the message and are optional.
They’re optional in the sense that some selectors do not require an
object, but if a message signature indicates that an argument is
required, it is mandatory. Arguments are used when the receiver of a
request for service also expects the requester to provide some of the
information needed to perform that service.
■ returnedObject is an arbitrarily complex object containing or repre-
senting the result created as a consequence of receiving the message.
In the case of imperative and declarative messages, the object
returned is “self,” that is, the object that received the message is indi-
cating it’s still available to you (usually by keeping an active pointer).
Chapter 5 Vocabulary: Words to Think With 129
Interface (Protocol)
The collection of messages that an object responds to and the state changes it
indicates it will accept registrations for constitute its interface. The term proto-
col is usually reserved for that portion of the interface listing the messages that
the object is willing to respond to. A protocol might include messages of the
sort, “What state are you in?” or “Are you in state X?” but those messages should
not be confused with the innate ability of every object to notify others of a
change in its state. The list of states and the mechanism for event registration
and dispatching are quite separate from the message protocol. The syntax of
each message in the protocol is specified and is considered the message signa-
ture. Where arguments are expected along with the message, the signature spec-
ifies the class (or type in some languages) of the object expected. The class (or
type) of object returned in response to the message is also part of the signature.
The preceding terms are considered essential because they embody every-
thing you need to know about objects to successfully decompose a domain,
identify and distribute responsibilities among a collection of objects, create a
taxonomy of objects, and even create scripts to guide objects in the completion
of specific tasks.
These terms do not provide sufficient definition for those charged with
actually implementing software objects. They provide a specification only.
Implementation requires concepts associated with the solution space—a pro-
gramming language and an implementation platform. Also required is vocabu-
lary for describing the “internals” of objects. A supporting vocabulary addresses
these needs.
130 Object Thinking
Extension Terms
The following terms, although of less philosophical importance than the essen-
tial terms, are nonetheless commonly encountered. They are useful because
they nuance or extend aspects of the essential terms and because they intro-
duce some ideas necessary to thinking about implementation.
Class
Class is a term with many meanings, including
Always remember that the hierarchy is based on behavior and that classes
lower in the hierarchy are assumed to extend the behavior of those above them
in their branch of the hierarchy.
Abstract/Concrete
Abstract and concrete are labels for classes that do not have instances and those
that do, respectively. In creating a taxonomy, it’s convenient and sometimes
necessary to create a class solely for the purpose of representing (and in
software taxonomies, storing) behavior common to two or more other classes.
These classes are not intended to have instances. Concrete classes have
instances, so by definition, all objects are instances of concrete classes.
Abstract classes are always parent classes. An abstract class should not
appear below a concrete class in the hierarchy.
In languages lacking explicit taxonomic relationships among classes (in
C++, for example, where the classes are simply members of a library with no
explicit enforcement of the is-a-kind-of relationship, as is the case in Smalltalk),
an abstract class represents a “template” for a set of related classes. Conceptu-
ally it fills the same role: a convenient place for storing specification or imple-
mentation material that applies to a group of classes, which in turn will have
actual instances.
Inheritance
Inheritance is simultaneously a metaphor, a definition, and a mechanism for
implementing the definition. As a metaphor, inheritance suggests a family lin-
eage. The definition involves the establishment of an is-a-kind-of relationship
between classes. In some languages, such as Smalltalk, there is a “built-in”
mechanism that implements, independent of any application, inheritance auto-
matically when the is-a-kind-of relationship is declared. In other languages,
such as Java and C++, the programmer must assume more responsibility for
implementing the mechanics of inheritance.
There are actually three different inheritance metaphors, two suggested by
biology and one by economics. In biology, a child inherits the genes of both of
its parents and hence shares some traits and capabilities based on its parentage.
Biology also suggests the possibility of creating global structure that shows how
the is-a-kind-of relationship connects all living things. This structure is called a
taxonomy, and the one you are most likely to be familiar with was established
by Carolus Linnaeus. The third metaphor is suggested by our practice of allow-
ing relatives to inherit the resources of their parents.
All three metaphors have been used to explain inheritance. As discussed
in Chapter 4, object thinking uses the idea of a taxonomy tree based on an is-
a-kind-of relationship as long as characteristics and behaviors are used as the
134 Object Thinking
criteria for establishing the relationship. Object thinking explicitly rejects the
idea of basing a class hierarchy based on “DNA”—the internals of an object,
such as its methods or its instance variables. The definition of inheritance then
becomes, “A superordinate-subordinate relationship between classes in which
the subordinate (child) has the same behaviors (responsibilities) as the super-
ordinate (parent) plus at least one additional.”
The compiler or interpreter behind your implementation programming
language needs instructions on how to actually implement the inheritance rela-
tionship—how to search parent classes for methods or variables not physically
present in the child class. In some languages, this mechanism is automatic and
generally not accessed by the programmer; in others, it must be specified for
each program. Languages with implicit inheritance built in, such as Smalltalk,
have the advantage of an inheritance mechanism that has been optimized over
time and as a result of experience. Languages that expect the developer to
explicitly create the inheritance mechanism, such as Java and C++, will be as
effective as the developer is skilled. The tradeoff is greater control.
When classes have one and only one parent, they are said to participate in
a scheme of single inheritance. Classes may have a grandparent, great grand-
parent, and so on, but the entire lineage is based on the fact that a class has
only one parent on the next higher level of the taxonomy tree. Multiple inher-
itance implies that two or more parent classes exist for a given child class.
Figure 5-5 shows a fragment of a possible class hierarchy. Person, Student, and
Employee illustrate single inheritance, while WorkStudyStudent is an example
of multiple inheritance. The circles, aStudent, anEmployee, and aWorkStudy-
Student, represent instances of their respective classes. Person is an abstract
class and has no instances.
The italicized entries in the classes represent messages that can be sent to
objects of that class to obtain an object holding the information implied by the
message name. Send the name message to the aStudent or anEmployee object,
and you will get back aString, representing that object’s identification.
Inheritance can be visualized as follows. The salary message is sent to the
anEmployee object. The employee object does not physically contain a method
enabling it to respond, so the inheritance mechanism kicks in, and the object is
given a copy of the method defined and physically stored as part of the
Employee class structure. The anEmployee object then executes the method and
returns the expected string object.
In another example, aStudent is sent the name message. This time, the
inheritance mechanism does not find the requested method in the Student
class, so it looks in the parent class, Person, where the method is found.
Again, the aStudent object is able to execute the name method and return the
appropriate value.
Chapter 5 Vocabulary: Words to Think With 135
Object
Person
name
single inheritance
an
Student Employee Employee
gpa salary
id id
aStudent
multiple inheritance
Figure 5-5 Inheritance tree fragment, showing both single and multiple
F05MQ05
inheritance.
Forward Thinking
Refactoring Stories
“Hi, Hector, we need to talk about these stories if you have some time.”
“Sure, glad to help. Should we stand over there by the whiteboard?”
“Yeah.” Hector and two pairs of programmers head for the white-
board. “Sally and Suroor are working on your story about updating
inventory, and June and I are working on the ‘menu displays available
products’ story,” Ron introduces the subject of the conversation. “During
the stand-up this morning, we started talking about the two stories and
thought we saw some overlap—for example, both the menu and the
inventoryReorderList need to know what products have been sold and if
any are left. So we went out to Vending Row and tried to visualize what
exactly goes on in both stories by looking at or imagining the objects
involved. We want to run our ideas past you and see if they are reason-
able and if they constitute some additional stories or modifications of
these two you gave us originally.”
“Sounds interesting. Shoot.”
“OK, I’ll start, and the others can jump in when they wish. Let me
draw on the board.” [Figure 5-6 shows the sketch Ron puts on the white-
board.] “Here we have the central object in these stories—the dispenser.
(continued)
Chapter 5 Vocabulary: Words to Think With 137
Figure 5-6 Hector’s rough sketch of the objects the group is talk-
F05MQ06
“We all think there should be some kind of ‘stock dispensers’ story,”
interjected Sally. “We watched the guy from the vendor company loading
the candy machine, and we think the story would cover the reorder list
watching the dispensers—all of them and all of their slots. When a new
product is put in a slot, the reorder list asks that object for its productId
and adds a line item to itself containing that ID. It also asks the vending
machine for today’s date and time, which it gives to the averageShelfTime
object, which in turn will use it to calculate itself later. This story applies
to all the slots in the dispenser, even the first one.”
(continued)
138 Object Thinking
“But the first one gets contents in a second way,” continues Suroor.
“When a product is dispensed, the dispenser pushes the next product in
line into the first position. All the other products get advanced as well.
Now, the reorder list doesn’t care about this event—it already has the item
in its list from the time the vending machine was stocked. All it cares
about is the event occurring when a product is dispensed.
“The menu, on the other hand, does want to know which new prod-
uct has arrived in this spot. So it registers to be notified of any product-
Replaced event that occurs in the currentProduct slot. It then asks the
product coming into that slot for its name, which it adds to the appropriate
spot on itself for display.”
“When a product is dispensed,” adds June, “the inventoryList wants
to know as well. It actually needs to be notified of a readyToDispense
event so it can ask the product for its ID before it’s pushed off the cliff into
the retrieval bin. It then tells the line item for that product to add 1 to its
count of total sold. The averageShelfTime object also gets the system date
and time at this point so it can calculate a running average of the time that
that particular product ID stays in the vending machine.”
Ron takes the stage again. “When the inventoryList is asked to trans-
mit itself back to the home office, it tells all the line items to execute its
reorderAmountRule. Then all the information in the four fields is ready for
transmission: each product ID to be reordered, the amount sold since the
last time the reorderList was requested, the amount to be reordered, and
the average time on the shelf in that machine.”
“But that’s not part of our story—the two Sals are working on that one.”
Hector looks puzzled for a second. “Oh, you mean Sally and
Salvatore. Gotcha.”
“There is another special case,” Suroor says. “If a product is put in
the currentProduct slot and it has expired, the menu shouldn’t display its
name; it should display a ‘sold out’ message or something instead. We
don’t think that needs to be a separate story, but we wanted to check with
you to confirm our thinking about the problem.”
“Seems to me you have it nailed.” Hector ticks his fingers as he
relates, “It seems you are suggesting five stories: stock dispensers, update
menu, dispense product, update reorderList, and transmit reorderList.”
“Well,” Ron replies, “we already have a dispense product story; we
just need to make sure that the pair working on it know about the needs
of the Menu and the reorderList. And I think that the update reorderList is
just part of the need we should convey to the dispense product pair.”
(continued)
Chapter 5 Vocabulary: Words to Think With 139
“OK, I’ll write the stock dispensers story and put it in the hopper for
the next iteration. We can just amend the narrative on the update inven-
tory story you already have to reflect our discussion. The same is true of
the update menu story. Those can stay in this iteration, then, and keep the
same priority—unless you think this will radically change your estimates?”
“No, if anything, it will make it easier, so we should finish in less time
than originally estimated when we didn’t really know what we were going
to do,” Ron says as the others nod in agreement.
“And,” continues Hector, “I will talk with the dispense product cod-
ers and make sure we have not changed their story so much we blow their
estimate. Good work, and thanks for the suggestions. I think this better
captures what happens and what we want in the final software.”
Delegation
Delegation is a way to extend or restrict the behavior of objects by composition
rather than by inheritance.
Consider an investment portfolio. A portfolio must be able to add and
delete investments, return a subset of investments (all the bonds, perhaps), iter-
ate across its members (asking each one its dividend date), and provide its cur-
rent value. All but the last behavior can be done by a collection object. So the
question arises, “Make portfolio a subclass of collection?” The answer, generally,
is no—give portfolio an instance variable, myInvestments, which contains a col-
lection object, instead, and delegate all the collectionlike behaviors of portfolio
to myInvestments. When you send a message like, “portfolio, what bonds do
you hold?” that question is delegated to myInvestments, which returns the bond
collection to portfolio, which returns it to you.
Delegation is one way to address the apparent need for multiple inheritance
in the case of a workStudyStudent. A workStudyStudent object could contain
within itself an instance of Employee and an instance of Student. It could then
define its own interface so that messages best handled by the anEmployee object
could be forwarded to the instance variable containing that object. The same
would apply to messages most appropriately handled by the aStudent object. Del-
egation eliminates the need for servers to be aware of their clients, and vice versa.
An object might want to advertise an ability to play different roles, and this
too can be addressed with delegation. The workStudyStudent might, instead of
creating its own protocol as a superset of Employee and Student, indicate that it
can assume either role upon request. Its protocol would then include two mes-
sages, asEmployee and asStudent, that would tell it to assume one of those two
140 Object Thinking
Polymorphism
When I send a message to an object, it has complete leeway to interpret that
message as it sees fit. The receiver of the message decides the appropriate
response and how to respond. As a sender of the message, none of that is my
concern. Because each object can interpret a message any way it wants (as long
as its protocol tells me what kind of object I can expect in return when sending
the message), more than one object can respond to an identical message.
Because every object has the right to define its own interface protocol,
it is not unusual for two or more objects to adopt the same message signatures.
A photograph and a document might both choose to implement a “print” mes-
sage. The details of printing will be quite different for the two objects, as will
the results. One message can yield many different responses, depending on
whom it was sent to. Thinking of each response as a form of response, we have
one message yield many forms (of response). The Greek for form is morph, and
poly used as a prefix means many—hence polymorphism (many forms). A bit of
a stretch, but that is where the term comes from.
Making the receiver of the message responsible for its interpretation gives
me a great deal of freedom in how I work with mixed objects. I can talk with
objects in ordinary vernacular. For example, I can ask them to print themselves
using a single message, “Please print yourself,” instead of remembering a different
message for each kind of printable object. A graphic object in the group will hear
the “please print” message and interpret it appropriately for a graphic, while a text
string will hear the same message and interpret it appropriately for a text string.
Polymorphism is a completely unremarkable phenomenon in the natural
world. We expect real-world objects to behave in this fashion and make jokes2
when situations arise in which objects respond to messages in unexpected
ways because they are polymorphic. Polymorphism is important in software
because it relieves me of the burden of coining an infinite number of message
variations so that I can satisfy the demand of a language compiler for making
every subroutine invocation unique.
2. There’s the joke about the large, leather-clad, menacing biker accompanied by his equally large and
fierce Doberman who enters an elevator car occupied by a middle-class couple. When the biker utters
the command, “Sit!” the couple as well as the dog immediately drop to the floor. The humor in this
story (if there is any) derives from the lack of polymorphism: the couple did not exercise their innate
ability to hear a message, determine whether it was for them, and react appropriately.
Chapter 5 Vocabulary: Words to Think With 141
Encapsulation
The personal integrity of objects should not be violated. This is such an impor-
tant principle that the defining term, encapsulation, might better be considered
an essential term. I include it in the supporting terms category because of how
it is used—as an explanation and justification for other terms in the object
vocabulary.
Every object has a boundary separating public and private realms. This is
true whether the object is a software construct or a person. That boundary is
held to be impermeable: even though we know it can be penetrated, it should
not be. Encapsulation defines the “insides” (structural definition and enabling
mechanisms) of an object as private space, to or of which no one except the
object itself should have access or knowledge.
In most ways, encapsulation is a discipline more than a real barrier. Sel-
dom is the integrity of an object protected in any absolute sense, and this is
especially true of software objects, so it is up to the user of an object to respect
that object’s encapsulation. For example, even though it is possible to insert
wires into the brain of a human being and, by applying small amounts of elec-
tric current, make that human perform tricks, to do so would be considered a
gross violation of the person’s integrity. Users of software objects should dem-
onstrate the same respect.
Encapsulation implies more than respecting the public/private boundary.
Object users should not make assumptions about what is behind the barrier
either. This is true whether the assumption is about a piece of knowledge that
might be stored in the object or about the details of any message response
mechanisms that might be inside the object. Just because an object indicates
that it can provide a bit of information doesn’t necessarily mean that the object
has that information stored within itself—it might very well be obtained from
some other object without your knowledge.
142 Object Thinking
Component
A component is a large-grain object made up of several basic objects. A roof
truss is an example of a component. It’s made up of 2 × 6 pieces of lumber and
gang nails. It simplifies the process of constructing applications (in the case of
a truss, a roof or a house). A component has an interface independent of the
interfaces of its members.
Components, excepting GUI widgets, are frequently known as business
objects, and an example might be a checkbook. A checkBook object is com-
posed of a checkRegister and a collection of numberedChecks.
The distinction among an object, a component, an application, and a
system is somewhat arbitrary, however “clearly defined” advocates may
define each term. All can be called objects because all are packages of behav-
ior with an external interface and all, even the most basic object, might con-
tain other objects.
Framework
Framework is another term with multiple meanings. The four most common are
implementation (for example, a set of GUI widgets); foundational (a partial
solution to a problem encountered in multiple applications or domains), an
implemented pattern (for example, resource allocation); application, or vertical
market application (for example, banking); and architectural (for example,
client/server).
Pattern
Pattern is a term with one description and at least two meanings. The common
description is, “A named solution to a recurring problem-in-context that has
instructional value.” The original meaning of pattern came from Christopher
Alexander and reflected his focus on the problem space—a pattern was observ-
able in the world, it could be described, and the description could be used to
replicate the pattern when useful. The most common meaning of the term
comes from the book Design Patterns, by the Gang of Four (GoF)—Erich
Gamma, Richard Helms, Ralph Johnson, and John Vlissides—for whom a pattern
is a programming design solution to a recurring programming problem.
Most of the people using the term have been inspired by the work of
Christopher Alexander, an architect who proposed a pattern language of
design parameters that would allow the construction of anything from an “inde-
pendent region” to a montage of photos on the wall of a dwelling.
144 Object Thinking
Implementation Terms
Those charged with the actual construction of software objects need vocabulary
to support their work—and support their object thinking—while dealing with
“the details.”
Method
Method is the name given to the block of code that is executed in response to
a specific message. Each message in an object’s protocol must have a corre-
sponding method.
As noted earlier, at this level it can be difficult to differentiate, visually
or syntactically, an object method from a traditional subroutine, function, or
procedure. Correct object thinking, however, will be reflected in the method
collective. As an aggregate whole, object methods will vary in significant ways
from a collection of routines or functions arrived at by applying traditional com-
puter thinking while programming. For instance, there will be fewer object
methods, and they will be simpler (on average) in their construction. Common
control structures, such as Case statements and explicit looping constructs, will
be absent (or if present, will be very few in number and will be used within an
object and not for object coordination or scripting).
Some of the methods used by an object might be considered private,
meaning that the object itself intends to use those methods and would prefer
that they not be invoked by other objects. Public and private are concepts that
apply to both methods and the messages that invoke those methods. An object
will frequently send messages to itself, resulting in the execution of a private
method, to obtain internally stored information or to obtain access to an object
created in another method. Some languages enforce a distinction between public
and private messages and their corresponding methods. Others do not, relying
instead on the integrity of programmers to respect the object’s design.3
Variable
A variable is a location or a container where an object might be located. Class vari-
ables are variables that are part of a class’s permanent structure. Instance variables
are variables that are part of an object’s permanent structure.
3. Languages such as C++ and Java also allow for protected messages/methods. This is a way to allow
outside objects to send such messages (invoke such methods) but restrict the number of outside
objects having that privilege. C++ also allows for friends, objects that have access to the private
messages/methods of other objects.
146 Object Thinking
Messages can be sent to a variable, in which case they are received and
responded to by the object residing in that variable location—the variable
becomes an alias for the contents (object in residence) of the variable.
Late/Dynamic Binding
This is another programming term that assumes a particular importance in the
world of objects. Type is a permanent4 label attached to an object—kind of like
a brand or a tattoo—that allows certain objects to be restricted to certain loca-
tions (variables) and allows a language compiler to enforce that restriction.
In some programming languages, the concept of type is minimized so that it
becomes important only when the program is actually executing. Those
languages are described as allowing dynamic, or late, binding. Not all program-
ming languages support dynamic binding, and whether or not they should is a
matter of much argument.
The value of dynamic binding lies in how it allows a developer to take
advantage of the natural polymorphism of objects in a direct and intuitive fash-
ion. It is possible, for instance, to create a variable, DisplayQueue, that will at
various times contain a text object, or a graphic object, or even a movie clip
object. I can send the display message to the DisplayQueue variable, and
whichever object is occupying the variable at that point in time will receive the
message, interpret it (polymorphism), and display itself. I do not worry about
the heterogeneous content of the variable.
A disadvantage arises from the possibility that I accidentally send an object
to DisplayQueue that does not know how to display itself, does not respond to
the display message. This can be prevented by asking any object seeking entry
to DisplayQueue whether it understands the display message. If it does, it’s
allowed in; if not, it’s refused entry.
The drawback of dynamic binding is the possibility that an inappropriate
object might come to occupy the variable, receive a message that it does not
understand, and cause the program to fail. In type-safe languages, erroneous
assignment errors of this kind will be detected by the compiler, flagged, and
corrected by the programmer before the program is allowed to execute. Unless,
of course, you cast types and get something like a Java “class cast exception”
error—the equivalent of Smalltalk’s “does not understand” error.
Solving this dilemma in a dynamically bound language is straightforward.
If the situation requires, I merely ask any object that seeks to occupy a variable
whether it understands a particular message or whether it’s an instance of a par-
ticular class, and I grant or deny residency based on its answer. This is extra
work, of course, and can have an impact on performance. Deciding when I
need to employ this kind of type checking is an important part of design and
of object thinking. The justification for allowing dynamic typing and inserting
explicit class membership checking when needed should be empirical.
Excepting the human interface, the probability of encountering a type error
should be quite low. If the consequences of error are minimal, the need to
insert extra code to check typing might not be needed. Simpler designs and
implementations should make implicit typing so obvious that programmer
error is minimized. The user interface will almost always have to enforce the
equivalent of type checking for every value entered, but once a value is “in
the system,” it should not need to be rechecked. Typing is sufficiently restric-
tive that programmers will employ features such as casting to escape the
restrictions. How many of which kind of errors, with what frequency, can be
prevented (or caused) by employing strict typing and allowing means for
avoiding type restrictions (casting)?
The merits of early and late binding are a source of considerable argu-
ment. We need not be concerned with that here. It must be noted, however,
that object thinking is better reflected in an environment that allows dynamic
binding. In the spirit that everything is an object, variables too are objects and
should have the responsibility of maintaining their integrity instead of giving
that responsibility to another object such as a compiler.
Auxiliary Concepts
The following terms do not define objects or concepts about objects. Instead,
they add nuances to, alter our understanding of, or enhance our perspectives
of those familiar terms.
Domain
The term domain refers to the arbitrarily bounded space we are simulating, in
whole or in part, with the objects we design and implement. We understand
objects based on how they reflect phenomena and concepts in the domain. A
domain might be a business enterprise or a type of business (for example,
banking or government). A domain might be nothing more than a focused com-
munity of objects collectively providing a particular set of services—for example,
the domain of graphics or the domain of money.
When we are constructing a class library or a set of components, our goal
should be to create a set that is capable of simulating the entire business enter-
prise or, preferably, the industry of which the enterprise is a member. It is
almost always a mistake to define the domain as coextensive with an applica-
tion program. A domain class library can be constructed incrementally as long
as every class added is a simulation of behaviors expected in the domain as a
148 Object Thinking
whole and not just the application in which a class is first encountered. Behaviors
can be added and moved via refactoring if the definition of classes is domain
driven. Yet this is the level at which too many object-oriented texts provide
illustrations and examples.
It is possible to define your domain as the computer—the implementa-
tion environment. This is, in theory, what object language designers do. If that
is your domain of interest, object thinking should apply as much to that
domain as it does to any other. Relatively few attempts have been made to
apply object thinking to these domains. Of course, it is precisely this area
where you might expect the greatest resistance to object ideas and the great-
est allegiance to machine thinking alternatives. Perhaps this is appropriate,
but it would be a lot of fun to seriously attempt the creation of an operating
system that reflects “pure” objects and nothing but objects. (There have been
attempts along this line, and Squeak, for example, has all operating system
services built into the class hierarchy so there is no need for an operating
system at all.)
This is probably a good point to insert a caveat about the material
presented in subsequent chapters of this book. Almost all of the examples and
discussions focus on application domains. Both an implementation domain
and an execution domain are assumed.
The implementation domain will be a programming language and its
accompanying class library. In most examples, we simply assume the existence
of objects such as strings, characters, and collections. Also assumed are typical
behaviors for those objects. Typical behavior is considered a superset of those
behaviors included in object programming languages such as Smalltalk, Visual
Basic, C#, Java, and C++. Sometimes, especially in dealing with collections, the
assumptions are biased by the capabilities of Smalltalk collections (and my
familiarity with that language), which are more extensive than in any other pro-
gramming language.
An execution domain consists of the virtual machine or compiler and the
operating system. Again, assumptions are made about services provided by these
entities. It’s also assumed that these entities are not generally object-oriented
environments. Because the operating system, for example, is not object-oriented,
it is frequently necessary to compromise object principles to some degree in
order to make it possible for objects to interact with nonobjects.
A special kind of execution domain would be a database management
system (DBMS). You could say that the very idea of a DBMS is antithetical to
object thinking,5 but such systems are an implementation necessity for most
5. Centralized hierarchical control and manipulation of passive data things: clearly, DBMS design, espe-
cially relational DBMS design, is not predicated on the kind of object philosophy and thinking dis-
cussed so far in this book.
Chapter 5 Vocabulary: Words to Think With 149
organizations. Almost from the inception of object development, there has been
conflict between object applications and DBMS execution environments. The prob-
lem even has its own name: the impedance mismatch problem. (See Chapter 10 for
further discussion.)
Business Requirement
A business requirement is defined as any task, decision, procedure, or process
that supports a business objective, goal, or mission. A business requirement
might be satisfied by an individual object or by a group of cooperating
objects. Those objects can be human, mechanical, or software based. If the
business requirement can be satisfied by a single object, it becomes a responsi-
bility of that object. If a group of objects is required, the business requirement
is most likely to be expressed as a set of individual object responsibilities plus
a script that ensures the proper coordinated invocation of those responsibilities.
Most of the time we will use story, as used in XP, as a synonym for business
requirement.
Application
Application is the term used for a community of objects focused on accomplishing
a well-defined set of collective responsibilities. As used here, the term applica-
tion has almost the same meaning in object terms that it does in traditional
software development.
6. Hammer, Michael, and James Champy. Reengineering the Corporation, Revised Edition: A Manifesto
for Business Revolution. Harper Business, 2001.
150 Object Thinking
Note We have come to the end of our vocabulary list and have not
included one of the most mentioned terms in object literature—reuse.
There are several reasons for this. First, reuse is not a goal of object
thinking; composability is. Composable objects will be reused as a
matter of course, so reuse is but a byproduct of a more general goal.
Second, there are ways to obtain reuse that are not related to object
thinking—code libraries, for example—and the distraction is not really
helpful. Lastly, reuse was once touted as the premier benefit of object
orientation—a claim that proved to be highly overstated. Worse, per-
haps, was the claim that maximum reuse could best be obtained via
inheritance. Object thinking claims to lead to the discovery and craft-
ing of composable objects. The goal is to create a mindset that leads
to evolving flexible applications and systems that directly reflect and
support an application domain. Reuse will emerge, but it is not a
driving force.
Method, Process,
and Models
Caveats to keep in mind as you read this chapter:
■ All methods are someone else’s idea about what you should do when
you develop software. It may be useful, from time to time, to borrow
from those ideas and integrate them into your own style. It is essential,
however, to transcend any method, even your own idiosyncratic
method, and “just do it.”
■ Software development is like riding a surfboard—there is no process
that will assure a successful ride, nor is there any process that will
assure that you will interact propitiously with the other surfers sharing
the same wave. Published processes, like published methods, provide
observational data from which you can learn and thereby improve
your innate abilities—just as observation of master surfers enables you
to improve yourself.
■ No model has any value other than to assist in object thinking and to pro-
vide a means for interpersonal communication. If you can model your
objects and your scenarios in your head while engaged in writing code,
and if those mental models are consistent with object thinking, great! No
need to write them down. If you and your colleagues use a visual model
on a whiteboard as an aid in talking about scenarios and in clarifying
your collective thinking about those scenarios, and you erase the board
when you’re done meeting, also great! If your models are crudely drawn
and use only a subset of the syntax defined here (or a completely differ-
ent syntax that you and your colleagues collectively agree upon), still
great! Model when you must, what you must, and only what you must.
151
152 Object Thinking
2. Very late in the life of ParcPlace Systems (the spinoff that marketed the Smalltalk developed at PARC),
the OBA tool was sold—under the name MethodWorks. But by that time, it had no hope of capturing
any share of the development tools market. MethodWorks provided a set of forms, consistent with the
OBA models, containing textual documentation about the nature and relationships of objects.
154 Object Thinking
The year 1991 was a watershed year for object methods in terms of books
published. Booch, Coad and Yourdon, Jacobson, Rumbaugh, Schlaer and Mellor,
and Wirfs-Brock published books describing various methods. All of these
methods could be characterized as first generation. They were all produced
quasi-independently and exhibited significant syntactic variation.
A great deal of argument ensued. Which method was best? Much of that
argument coincided with arguments about implementation languages. It was
common for methods to be closely associated with languages and praised or
damned based on that association. For example, Booch’s method (which was
originally written to support Ada development) was preferred in the C++ com-
munity, while Wirfs-Brock was more popular with the Smalltalk crowd.
Chapter 6 Method, Process, and Models 155
3. A huge discrepancy remains between what developers officially use and what they actually use, in
terms of both method and model. Licenses sold still does not equate to actual use by developers.
4. Coad’s later and independent work was far more focused on behavior and patterns of behavior among
groups of objects.
156 Object Thinking
calculateFee
acceptFee Passenger
Fee was an attribute of Title and Registration -
moved to Legal Event superclass.
Truck
calculateFee and acceptFee methods placed
with class containing data. Both are coupled to Title Registration
entire Vehicle hierarchy. Code must therefore be Motorcycle
implemented with case statement and modified
every time the Legislature decides to implement Trailer
a new tax rate or vehicle type to be taxed.
after Coad and Yourdon, 1991), data modeling rules lead the designer to
place the fee attribute and therefore the calculate fee method in the Legal-
Document class. This mandates the need for a case statement to handle
fee calculations and couples LegalDocument to the entire Vehicle class
hierarchy.
Chapter 6 Method, Process, and Models 157
Customer
custId Is-a-kind-of
fName
lName
MI
CreditCustomer
The creditLimit attribute “does not apply”
to all customers. By the rules of normalization cCustld
it must be moved to another entity - a subtype creditLimit
of customer. Entities proliferate needlessly.
5. Only nominal attention is paid to the process of developing a domain class hierarchy as a tangible
product in most software engineering methods.
158 Object Thinking
■ ParcPlace Systems chose not to market the tool (OBA) it had created,
although it did provide the tool to those taking its object analysis and
design seminars.
■ Beck and Cunningham actively lobbied against the creation of any
kind of automated CRC tool and, today, argue against automation of
story cards in XP. Their objective was quite sound, philosophically,
but disastrous in terms of marketing.
■ Knowledge Systems Corporation developed a tool named coDesign,
based on Smalltalk, that was highly regarded by those that saw it
demonstrated. It never became a commercial product because of
financial and political concerns within KSC.
■ Corporate information technology organizations were actually mov-
ing to adopt Smalltalk at this time but refused to give up their rela-
tional databases, so tool vendors concentrated on object-relational
mapping tools instead of behavioral modeling tools.
6. Booch is a notable exception to this rule. He clearly recognizes that a fundamental shift in thinking is
required for object development. He also clearly recognizes the need to decompose the world based
on the domain expert’s point of view. He parallels Parnas’s views on domain-centric (design-centric)
decomposition. His method, however, does not develop or directly support this aspect of object
development. Instead, his models and syntax are directly focused on what is needed to construct the
software artifact.
Chapter 6 Method, Process, and Models 159
The first, and for a long time only, book promoting the behavioral
approach to objects was that of Wirfs-Brock, Weiner, and Wilkerson. Nancy
Wilkinson published a small volume outlining classical CRC cards a few years
later—long after the opposition had all but won the “method war.”
Second, and more important, behavioral approaches were the least devel-
oped in terms of expressiveness of models and making the transition from analysis
to design and implementation in a traceable fashion. It would not be misleading to
characterize behavioral methods, circa 1991, as “CRC cards—then Smalltalk.”
Wilkinson, in fact, suggests that the primary value of CRC cards and
behavioralism is to provide an informal and rapid way to obtain input for more
formal software engineering methods. Booch, OMT, and OOSE (Jacobson’s
Object Oriented Software Engineering) were the formal software engineering
methods she seemed to have had in mind.
Third, behavioral approaches are the most alien to established software
developers—even today. Thinking like an object is very different from traditional
conceptualizations of the software development process. It requires, at least at
the beginning, constant diligence to avoid falling into old mental habits. It is hard.
Most people are unwilling to engage in this kind of hard cognitive work without
a compelling argument as to why it is worth their while. That argument was never
made—except in a kind of oral tradition shared by a very small community. This
book is an attempt to capture several aspects of that oral tradition. As with XP, the
primary justification for object thinking derives from a better fit between informa-
tion technology and business and significant reductions in complexity.
In fact, behavioralism had the same reputation as XP does today—as being
anti-method. There is a small element of truth in this assertion. Both OO and XP
proponents oppose the use of methods as traditionally defined—especially
comprehensive, highly formalized, and labor-intensive methods that prevent
developers from immediate engagement with code—with programming.
This does not mean that object thinking lacks anything resembling a
method. (The same is true of XP.) It merely means that the rigor and the sys-
tematization of work that accompanies object thinking is quite different from
what most developers have come to associate with the term method.
To understand the relationship between method and XP, it’s necessary to take
a few moments and reflect on how method provides value to software developers.
expansion from small working systems—have been used and advocated almost
since the inception of commercial computing but have never been accepted as
“official” methods.
Other methods are more prescriptive, instructing the developer as to what
to do and when to do it. The simplest form of a prescriptive method would be
a checklist, such as that used by pilots for each phase of flight. Such checklists
consist, essentially, of a set of questions of the form, “Did you remember to do
this action?” Actions that need to be done in a particular order simply have their
reminder questions occur in the necessary sequence.
Most software engineering methods are highly prescriptive—with precise
instructions as to what and how to develop software at each meticulously
defined step in a carefully arranged process. They are based on a value system
that incorporates a basic mistrust of the human worker. Such methods can
become highly complex and comprehensive as the checklist expands to include
documentation that must be produced to confirm that each action did in fact
take place, as well as syntax that specifies the exact form of the documentation
so that it is known that the action was done correctly. (I have seen one such
method that filled almost 20 volumes—defining each step, describing each doc-
ument or artifact produced, and including algorithms for determining the cor-
rectness of all artifacts produced.)
Between hacking and prescriptive overkill is the realm of formal, informal,
and aformal methods.
Formal methods tend to be prescriptive. They are characterized by a large
number of models each of which requires a reasonably complex syntax, they
are filled with rules and techniques that assure proper use of the method, and
they are fairly strict in terms of activity sequencing. Most offer a promise of
removing human developers, to some degree, from the development process—
via code generation, for example.
Informal methods require fewer models with simpler syntax, demand
fewer activities, and offer heuristics instead of rules and techniques. Most pick
a single activity—programming, for example—and elevate it to primary status
while suggesting that all other activities are valuable only insofar as they
support the primary status. XP shares these characteristics and would be called
an informal method.
An aformal method7 would reject the idea that any task, model, syntax,
rule, technique, or heuristic has any intrinsic value. Such things are valuable
only to the extent that they support or assist the innate capabilities of the
human developers engaged in a particular task at a particular moment in time.
7. Aformal method is almost, but not quite, an oxymoron. Some familiar aspects of method remain even
in the most aformal approaches to software development.
Chapter 6 Method, Process, and Models 161
Both formal and informal methods are seen as a kind of exoskeleton that might
offer some protection, but at the cost of severely limiting the being “enjoying”
that protection. Improving the innate character and capabilities of the human
developer is the alternative to defining an external method, for an aformalist.
Aformalism might also be considered “master practice.” Craftsmen have inter-
nalized those aspects of informal method and practice most germane to their art
and have transcended them.
An analogy to chess playing might illuminate the relationships among
method categories. A beginning chess player follows rules and defined proce-
dures (they are formalists), while a journeyman (informalist) relies on patterns
and heuristics. A grandmaster has internalized and transcended the informal to
become an aformal player.
Methods themselves are less important than the culture shared by those
that embrace a method. Software engineers, for example, represent a culture
enamored of formal methods (even if they cannot use them). (There are excep-
tions to this rule: Dave Thomas, for example, sees engineering as creative and
aformal problem solving independent of any formal method or process. It is
hard, however, to find that attitude reflected in software engineering texts.)
Those methods are considered necessary and desirable because the method
expresses the set of presuppositions, values, and worldview shared by the
members of the culture. Formalists like formal methods—an obvious truism.
Managers; academics; software engineers; computer scientists; and propo-
nents of UML, RUP, and CMM all tend to be formalists. Practitioners, as Robert
Glass has shown, generally are informalists. XP and object thinkers aspire to be
aformalists.
Methodological conflicts, therefore, are really cultural conflicts. When an
advocate of RUP asserts that “RUP is agile,” he or she is making an irrelevant
statement. Of course, RUP can be agile—it is merely a tool, after all, and the
practitioner has the choice of how, when, and why to use that tool. But some-
one from the culture that values RUP cannot be agile. (OK, technically, will not
be agile. OK, OK, is very unlikely to be agile.) The same mostly nonconscious
worldview that leads to adoption of RUP and UML will prevent the use of that
method in any but a formal way unless a constant, conscious, and deliberate
effort is made to adopt the agile worldview and cultural values at every step of
development.
Formalists will advocate methods that are focused on the production of
computer artifacts (software programs). Such methods will liberally employ
terms such as software engineering and will stress correctness and both syntac-
tic and semantic integrity. It is held that such methods are capable of producing
a “correct” solution to an unambiguous requirement, prior to the expensive
process of committing it to code. Code generation is then a happy byproduct of
162 Object Thinking
formal methods. The major drawback, of course, is that the effort required to
produce the formally correct models is essentially the same as (or more than)
that required to code and test. (Code, ironically, is far more amenable to formal
testing than any abstract model. As Ken Auer says, “Bubbles and arrows never
crash; they also never run!”) This makes for a steep learning and overhead curve
for those using this kind of method. They will also suffer from some degree of
mismatch between the real world and the formal world they attempt to
describe. The real world is far fuzzier, flexible, and illogical than any formal
method can accommodate.
Informalists are more likely to focus on methods that support negotiated
understanding—for example, the informal communication-oriented methods such
as joint application development (JAD) and CRC. To the extent that they adopt
modeling techniques, informalists see the models as a means of communication—
not an artifact with intrinsic value. It is clearly recognized that such models are
bound in terms of time and are meaningful for the group involved in their
creation. That is why the development group must include users, managers,
analysts, programmers, documenters, maintainers, and so on. They will
understand the models only if they participate in their construction. Reinhard
Keil-Slawik 8 shows how such models (including code) serve as a kind of
external memory for the group that created them and works with them. The
primary problem with these methods is the lack of technique for translating
the human understanding of a solution into a “computer understanding.” The
computer, after all, is a formal machine and can operate only on formally
defined products. This explains the tendency of informal methods (XP, rapid
prototyping, open source, and so forth) to focus on programming—the actual
interface between formal machine and informal developer.
Aformalists appear to reject method entirely. Observation, however, reveals
patterned behavior and tasks performed in a sequential manner. Models are
constructed (on whiteboards, Post-It notes, and 4 × 6 cards more often than with
the use of an automated tool), giving those models a relatively short half-life.
Aformalists do not reject method so much as they reject the idea that methods and
models have any intrinsic value apart from those using them in a specific context.
In one of the Alien movies, Sigourney Weaver’s character fought the alien
monster using a mechanical exoskeleton. This exoskeleton greatly increased
her human strength by amplifying her human movements with electromechan-
ical means. Formalists tend to see method as a similar kind of exoskeleton, one
to be wrapped around a human developer in order to amplify his or her skills.
8. Floyd, Christiane, Heinz Zullighoven, Reinhard Budde, and Reinhard Keil-Slawik. Software Develop-
ment as Reality Construction. New York: Springer-Verlag, 1992.
Chapter 6 Method, Process, and Models 163
9. It is true that some etudes are themselves sufficiently beautiful that they get played in concert, just like
any other kind of music composition. This does not detract from the intent behind their creation.
164 Object Thinking
a gate that must be passed through and left behind before you can actually
practice the “Timeless Way of Building.”
For object thinkers, method is never an end in and of itself. There is no
intrinsic value in either method or process. Both are useful only to the extent
that they provide practice in the use of, and a means of enhancement for,
innate human capabilities. Within the context of this worldview, it is possible
to ask whether some methods, some tools, some models are more suited to
promoting object thinking than others. And the answer is yes. To determine
which methods, tools, and models are the most efficacious, the following criteria
can be used:
■ The method, tool, model, or process cannot substitute its own goals
in place of those articulated in object (or XP) philosophy.
■ Each task advocated by the method and each model created using
the method must contribute to the realization of basic goals.
■ The models, vocabulary, and syntax associated with the method and
its models must value expressiveness over correctness. Models must
evoke knowledge in the head of the developer instead of making
pretensions to unambiguous representation of that knowledge.
■ The methods and models must
❑ Provide support for “natural” decomposition and abstraction of
problem (enterprise) domains. This requirement refers back to
the simulation notion behind SIMULA and the object paradigm.
❑ Recognize a need for two complementary processes: one
focused on domain modeling and the second on application
assembly.
❑ Include heuristics for discovery and evaluation. Heuristics
should be grounded in appropriate metaphors to facilitate
learning.
❑ Include heuristics or metrics that allow you to measure
progress and the “goodness.”
A Syncretic Approach
The preceding discussion emphasizes the differences between formal and afor-
mal approaches to software development. It might lead one to suspect that the
gulf between the two philosophies is unbridgeable—especially when consider-
ing method.
Chapter 6 Method, Process, and Models 165
Even hard-core object purists recognize that there are many things of
value even in the most formal of methods. Blending methods and approaches
presents a significant challenge.10 Incorporating valuable ideas from formal
methods in such a way that the worldview and values of object thinking are
preserved is equally hard.
Nevertheless, it is desirable to find some kind of common ground. Two
prerequisites are required. First, the term method will be abandoned in favor of
approach. This is purely a political move—to eliminate distractions caused by
the “M-word” itself. Second, we will borrow a concept—syncretism—from
anthropology and religious studies as a metaphorical springboard for develop-
ing a syncretic approach.
Syncretism refers to a particular type of blending of traditions and cul-
tures. For example, a visitor to a Catholic church in the Caribbean or South
America will almost certainly find representations (icons, statues, relics, feast
days, and so on) of Catholic saints that are indistinguishable, on the surface,
from “pagan” deities. These vernacular adoptions do not change the underlying
principles of Catholicism; they merely make those principles more accessible
(as in the use of vernacular in the mass) by interpolating a mediating form. A
syncretic approach to software development would be characterized by a
smooth transition from behavioral decomposition and analysis into representa-
tions sufficiently formal that they can be implemented as computer software.
(In XP, this transition takes place in small steps, one story at a time.) Along the
way, the user would see many elements borrowed from other sources, ele-
ments that might even be redefined in various subtle ways to maintain consis-
tency of expression. It will be quite possible to maintain object thinking and XP
practice while drafting UML models that are syntactically, but not semantically,
identical to UML models drafted by a traditional software engineer.
Using the label syncretic approach is deliberate. Although many will take
what is advocated in this book as YAM (yet another method), the intent is to
create an approach to thinking about objects that nevertheless allows adoption
of techniques, insights, or models that may have originated in traditional com-
puter science and software engineering. Forms may be adopted from formalist
methods, but never underlying principles or philosophies. Succeeding chapters
will develop the syncretic approach more fully, but the remainder of this chap-
ter will provide a summary of the process and a quick definition of the models
(all of which are adapted from existing methods) that will be employed.
10. UML and RUP, it has been reported, took a lot of compromise and negotiation before they were
hammered out, and the three methods synthesized there were basically similar. The elements of
behavioralism in Booch were essentially discarded to make the synthesis possible. It proved much
harder to combine behavioralist and software engineering approaches, although a product named
Fusion, from Hewlett-Packard, made a valiant attempt.
166 Object Thinking
11.Evans, Eric. Domain Driven Design—Tackling Complexity in the Heart of Software. Boston: Addison-
Wesley, 2004.
Chapter 6 Method, Process, and Models 167
Forward Thinking
Review
One Friday afternoon the team is getting ready to leave, when Sally looks
around the room as if seeing it for the first time. “You know,” she says
almost to herself, “this place is a pretty good visual metaphor.”
“How so,” asked Ron, who was standing nearby.
“Well, there are the obvious things, like all the charts on the
wall, the bulletin board with story cards; they are visual metaphors for
communication.”
“A lot of projects have walls full of charts and diagrams.”
“Yes, but ours tell the truth. People believe them because they show
both good and bad—just the facts ma’am,” Sally said with a rather bad imi-
tation of Jack Webb as Sergeant Friday. “Our documents are not fancy
or polished, but they are useful—pragmatic aids to communication, not
valuable artifacts in themselves.”
“They’re playful, too,” suggested Ely as he joined the conversation,
“like those object cubes that Dan made by taping three-by-five cards
together. Remember the way that Suroor and I were juggling them as we
talked through that problem last week?”
“And they can be stacked up—a metaphor for how you can build
things with objects. As useful as they were, the old CRC cards could not do
that easily. Building a house of cards is a lot harder than a house of blocks.”
“A cube is a pretty simple shape—and XP prizes simplicity.”
“It would take a videotape to show it, but the way our walls came to
be covered in paper would contribute to the metaphor as well. When we
started, the walls were bare; it was only as our knowledge of what we
were doing increased that we had a need to externalize our group mem-
ory with the diagrams and object cubes.”
Most of the team had joined the discussion by now, and Sally was
looking around the group. “There is something else, maybe the most
important thing of all—you. If you look at the people in this room, you
see something very different than you would in any other software shop.
(continued)
168 Object Thinking
Models
Models are valuable only to the extent that they facilitate communication
among human beings. (A model that can be “understood” by a computer is a
programming language.) This implies that the effort required to construct the
model must be less than the communication value that arises from its use. The
dramatic failure of CASE can be traced almost entirely to the fact that the effort
required to learn and use the tools far exceeded the ability of resultant models
to facilitate communication.
Unfortunately, a learning curve and some degree of overhead will always
be associated with the use of any set of models and any automated tool
Chapter 6 Method, Process, and Models 169
supporting the construction of those models. It’s the balance between benefit
and cost that’s critical in determining whether models and tools will be useful.12
In that spirit, none of the following are essential in the sense that you cannot do
object thinking without them. None of the models have fixed syntax or content—
what is presented is suggestive. All of the models can and should be simplified
as the developer internalizes object thinking skills—until, as with the Cheshire
cat, only the model’s “smile” remains to evoke the knowledge in the head of the
developer and of the development team.
Semantic Net
A semantic net consists of little more than nodes, arcs, and text labels (see
Figure 6-3), with nodes representing things and arcs representing relation-
ships among those things. Nodes are labeled with a noun or noun phrase and
relationship arcs with a verb or verb phrase.
verb phrase
Noun
Phrase
Noun
verb phrase
Phrase
objects in a domain.
12. Booch clearly recognized that developers had an upper limit on the amount of time they were willing
to expend learning a method or syntax. He advocated the use of a subset of his full modeling set,
called whimsically “Booch Lite,” as the kernel that was most useful most of the time.
170 Object Thinking
The model produced need not persist beyond the point when the objects,
responsibilities, and constraints identified have been transferred to other
models (such as the object cube). The LIMT sidebar illustrates a typical use of
a semantic net.
1. A couple must have been married at least 1 year but not more
than 10 years.
2. Both spouses must be gainfully employed. At the time of appli-
cation, proof must be submitted of full-time employment for at
least 48 of the previous 52 weeks.
3. The couple meets the LIMT definition of financial need by
meeting one or both of the following requirements:
(continued)
Chapter 6 Method, Process, and Models 171
(continued)
172 Object Thinking
(continued)
Chapter 6 Method, Process, and Models 173
makes a weekly
provides has
Mortgage Investments Payment
Grant
is-for-a is-for-a
Price
must be < or =
completes has-a
Application
Couple
Home Median Price
associates
has-a has-a
Marriage Neighborhood
Employer
Object Cubes
An object cube is derived from the CRC card as invented by Beck and Cunningham
and elaborated by Wirfs-Brock (particularly stereotypes). Object cubes offer
single, consistent, metaphor-preserving model objects. The model is used to
aid thinking about decomposition as well as design and some aspects of
implementation. Each of the six sides of the cube, illustrated in Figure 6-5
through Figure 6-10, captures one critical aspect of the conceptualization of
an object.
Figure 6-5 The classic CRC card view of an object (LIMT example).
F06MQ05
example).
id add: anInvestment
id: aString delete: anInvestmentId
instantiate return: aSpecification
validate totalValue
rules
rules: aCollection
Interaction Diagram
Interaction diagrams are versatile: they’re used to aid discovery as well as to
capture implementation specifications. They model the communication among
a group of objects engaged in a particular task. Most behavioral object thinkers
13. Historically, contracts could be used to aggregate messages by the class of potential senders.
Contracts can also be used to reflect the “method categories” that appear in some IDE browsers
for some languages. Care should be taken in this case to avoid contracts that are language or
programming tool specific.
176 Object Thinking
employ the term scenario for interaction diagrams or a nested set of such
diagrams. Each scenario is bounded by a precondition (what must be true and
what message must be sent to initiate the scenario) and a postcondition (what
is to be returned when the scenario completes normally). Figure 6-11 illustrates
the syntactic components of an interaction diagram. Figure 6-12 uses the syn-
tactic elements of Figure 6-11 to capture a specific conversation—filling in and
validating an application for a mortgage.
Class Class
Message
Object Returned
Obj Ret
Loop subdiagram
Branch subdiagram
branch subdiagram
(usually error handling)
Instantiate
nextEntryField
anEntryField
value
mySource
infoSource
value
anObject
validationRules
aRuleCollection
nextRule
aRule
evaluate
self aBoolean
validationRules
aCollection
nextElement
anObject
self
Human user value is (x) Entry field self Iterate until all
fields have values
diagram.
178 Object Thinking
Figure 6-14 This text-only binary use case model captures the same
F06MQ14
Object
Form
DataSource
Interface
Mortgage Valid
Application Collection
Collection Investment
F06MQ15
accesses
Employer
accesses
Bank
accesses
Assessor
completes
Couple
uses DataSource
Interface
Collection Payment
uses Calculation
Person Mortgage Form Element
Collection
Object
Insurance
Agent
F06MQ16
Figure 6-16 A gestalt map provides an overview of the objects and their
static relationships.
ClassName.VariableName
initialValue has-a
defaultValue
type (e.g., integer, date, string
domain (set of legal values)
label className.Description
type: valueHolder
composed-of
= State A
trigger (guard)
state 1
action
A = Exclusive - or
B
(either state A or B)
A
Transition via
A B "history" — return
H B
= Concurrency to same substate
(A+C, A+D, B+C, or B+D) as last line
C D C
Figure 6-18 The most commonly used symbols borrowed from Harel.
F06MQ18
Properly defined and designed, most objects will have an exceedingly simple
state. Therefore, the use of this kind of diagram to model object state is seldom
required. Object state charts are extremely useful for modeling state-driven
interactions among objects, such as the interactions that occur in a typical GUI.
I’d like to conclude this chapter by repeating one of the caveats presented
at the beginning: no tool has any value other than to assist in object thinking
and to provide a means for interpersonal communication. If you can model
your objects and your scenarios in your head while engaged in writing code,
and if those mental models are consistent with object thinking, great! No need
to write them down. If you and your colleagues use a visual model on a white-
board as an aid in talking about scenarios and in clarifying your collective
thinking about those scenarios, and you erase the board when you’re done
meeting, also great! If your models are crudely drawn and use only a subset
of the syntax defined here (or a completely different syntax that you and your
colleagues collectively agree upon), still great! Model when you must, what you
must, and only what you must.
Discovery
It is said, “A journey of a thousand miles begins with a single step.”
—Anonymous
This adage is usually quoted as a motivation: “Get started, and the rest will
follow.” The adage misses the potential problem, however, of what happens if
that first step is in the wrong direction. It isn’t necessary to be a fan of chaos
theory to recognize that even the smallest change in initial conditions (the first
step) can have enormous impact on the eventual results.
For instance, suppose you are in Albuquerque, New Mexico. (Bugs Bunny
was famous for making a wrong turn here.) You want to go to Washington,
D.C., following a direct line slightly north of east. Unfortunately, you were
celebrating your coming departure last night, you arose much later than usual,
and, thinking it was morning and the sun was rising in the east, you headed off
in the direction of the sun. You might still get to Washington, D.C. (the Earth is
round, after all), but your journey will be rather tortuous and take an inordinate
amount of time.
Beginnings are just as critical in software development, and initial mis-
takes are a lot more common than one might suppose. A truism of software
development is that the most costly mistakes are made the first day. Two major
factors make beginnings so perilous in software. The first is simply a lack of
knowledge. We know the least about the what, the how, and the why of our
development project at the beginning. This should be so obvious that it need
not be stated, but surprisingly, we insist on making critical decisions about
projects (such as overall design, timelines, and costs) at the very time we are
least prepared to make them.
183
184 Object Thinking
Management usually takes the heat for this mistake. An oft repeated
statement (that I heard in a keynote speech at a conference, but is really a
paraphrase of a famous Santayana quote 1) is, “Insanity is doing the same
thing that failed last time and expecting it to work this time.” Management, it
is said, is guilty of precisely this and therefore should be considered insane.
But it is not insanity at work here—it is culture. If the rationalist philosophers had
been correct and the formalist software engineers had been correct, it would
have been perfectly reasonable to assume that we should be able to define per-
fect specifications and derive working software from those specifications with
mechanical transformations. Computer scientists, software engineers, and ration-
alist western culture in general have been selling management a bill of goods.
The second most common source of error, especially by experienced
developers, is to anticipate how the computer is going to implement your soft-
ware before trying to understand how the software should simulate some part
of the domain in which it is going to be used. This is computer thinking, as
described in earlier chapters. If you start the development process, as is almost
always done, focusing first on what you are going to tell the computer to
do and how it is to do it, you have started your thousand-mile journey with a
180-degree misstep. There may have been a time when computers were so
hard to use, limited in capability, and expensive that it was expedient to use
them and their requirements as a lens through which the rest of the world was
“cut and measured,” but that is clearly not the case today.
1. Original quote from George Santayana: “Fanaticism consists in redoubling your efforts when you have
forgotten your aim.”
Chapter 7 Discovery 185
implementation can give you a general answer. When you are first thinking
about writing tests and code, you will think about how you are going to imple-
ment a specific story. You will have already done the design, the identification
of objects, visualization of the basic conversations among those objects, and the
assignment of methods to those objects involved in your story—quite possibly
in your head or via discussion with your pair programming partner. Thinking
about the code at this point provides useful feedback. You might discover you
have a bad design, bad language, or code that needs refactoring.
It’s never appropriate to tell yourself, “This is what the code will look like,
so I need an object to hold these parts of the code, and another to hold these
parts, and another to make sure these two do what they are told to do when
they are told to do it,” which is precisely what structured development tempts
you to do.
Perhaps the greatest benefit of object thinking is that of helping you start
off in the right direction. Object thinking does this by emphasizing the need to
understand the domain first.
Domain Understanding
Understanding the domain involves five types of mental discipline reinforced
by object thinking principles and ideas:
■ Extract your understanding of the domain from the domain; use the
metaphor of domain anthropology to guide this effort. The goal of
software development is to create artifacts, with each artifact consist-
ing of an admixture of hardware, software, processes, and interfaces
allowing interaction with other artifacts or with people. Deciding
which artifacts are needed and how they will be required to interact
with existing (and planned) artifacts as well as with people is a result
of understanding the domain—as the domain is understood by its
inhabitants. (See the sidebar in the next section of this chapter,
“Domain Anthropology and Management.”)
■ Decompose the problem space into behavioral objects, and make
sure the behaviors assigned to those objects are consistent with user
expectations. This requires understanding why users make distinc-
tions among objects and the illusions they project on those objects.
User illusions (following Alan Kay) consist of how people recognize
different objects in their world and, having recognized an object,
what assumptions are made about how to interact with that object
and what its responses will be.
186 Object Thinking
This chapter will discuss how object thinking influences your understand-
ing of the domain, its objects, and the models useful for clarifying and commu-
nicating your understanding. Chapter 8, “Thinking Toward Design,” will outline
how to move toward implementation without abandoning object thinking or
our understanding of the domain.
Domain understanding involves using another metaphor, domain anthropol-
ogy, to provide the mental perspective used when discovering objects and their
interactions. The same perspective is useful for identifying and assigning discrete
services to specific objects. A number of heuristics can be employed to facilitate
object discovery and definition. I will now discuss each of these factors in turn.
Domain Anthropology
The software developer must confront a strange world with the goal of under-
standing that world in its own terms. A close approximation of this task is the
work of a cultural anthropologist confronting a strange (to her or him) society.
Domain anthropology provides a very useful metaphor—providing both
Chapter 7 Discovery 187
cautions and insights that will guide the application of object thinking to the
early phases (requirements definition, object identification) of development.
Software expertise does not trump domain expertise. The longer a software
developer works in a domain, the more effective her software work will be.
I begin with a caution: anthropologists have their own culture—with its
associated explanations, values, assumptions, and so forth—and they must zeal-
ously guard against the mistake of interpreting everything in the new society in
terms of their own (often unconscious) culture and values. This kind of cultural
relativism should be respected—the software developer does not have a “special”
viewpoint that allows him to judge or alter the culture he is working with.
Software developers, on the other hand, are fair game for evangelistic
efforts. Most developers are steeped in the “way of the computer,” with abun-
dant assumptions about how a computer works and the best ways to make a
computer perform its tricks. You could say that developers have internalized a
culture of computing. The fact that this book—as well as the object and XP
movements in general—is trying to change developer culture does not imply
that developers have a corresponding right to change user or organizational
cultures. Developers, traditional or reformed, must set aside their professional
culture (just as the anthropologist sets aside his or her birth culture) before they
attempt to understand users and user domains. Following this injunction is
inconsistent with the goals and intents of the stereotypical “computer geek”
who has invested a lot of time and energy to think like a computer.
When a cultural anthropologist confronts a new culture, the first task (after
allaying suspicion and obtaining some kind of rapport) is to learn the language.
The object developer needs to learn the names of things in the domain that
have been accorded object status by the natives—made distinct from the
domain and from other things in the domain—by virtue of having been given a
name. Naming things is how domain experts (and the indigenous peoples studied
by the cultural anthropologist) naturally decompose their domain.
Given that management will likely not allow time for a complete ethnogra-
phy, some kind of conversation about the domain with both users and developers
participating is desirable. Constructing a semantic net (see Chapter 6, “Method,
190 Object Thinking
Process, and Models”) is a useful way to gather information about potential objects
and expectations of those objects. While constructing this net, the domain anthro-
pologist must operate, somewhat, as if she were a naive child—constantly asking
“What is this?”
“Why?”
The answers to these questions not only reveal potential objects but also start
to reveal the expectations that domain experts have of those objects. Begin the
object discovery via the semantic net technique by asking for one or two sen-
tences about the domain in general, such as two sentences that describe what your
company/department/team does. Select a couple of nouns and verb phrases, and
write the first elements of a semantic net (see Figure 7-1) on a whiteboard. Ask
everyone present to brainstorm new elements (circles, nouns) and new connections
(arcs, verb phrases). This exercise should be a stream of consciousness—
brainstorming—session, with analytical discussion to follow later.
Completes
Couple Application
Mortgage
Trust
Has_A
Is_For
Funds
Legal MTGE
Marriage
Is_An
Investments
Secured_By
Has_A
Home
Marriage Is_In_A
Date
?????? Neighborhood
Today's
Date
It usually takes but a short period of time, five to ten minutes, to produce a
fairly large diagram. The circled nouns provide a rich set of potential objects, and
the relationships provide an equally rich set of potential responsibilities (expec-
tations of those objects). This semantic net can then be placed on the wall as a
common reference point as the discussion proceeds to more detailed levels.
(continued)
192 Object Thinking
the amount of money in the pool and fund all we can. Any leftover money
is invested.
People have to apply for the mortgage? (Note the naive question.)
Of course they fill out an application, and when the information on
the application is verified, the application is deemed fundable. If we have
money, we grant the mortgage and the application is given funded status.
If we do not have the money this week, the application stays fundable
until it is funded or some other event causes it to be canceled.
One reason for reducing the object discovery process to simple questions
and observations is to eliminate preconceptions. If a cultural anthropologist
were to begin an analysis of kinship with the preconception that everyone lives
in a nuclear family (mother, father, and 2.5 children) and that everyone practices
monogamy, her analysis of human kinship patterns would be so incomplete and
distorted that it would be worthless.
An analogous result will occur if the domain anthropologist begins her
task with preconceptions about data, functions, processes, how things must be
implemented in COBOL, or how computers work. These preconceptions about
implementation will blind the domain anthropologist to what is going on in the
domain and what is required of the new software artifact. For instance, a soft-
ware expert is likely to see any kind of form as an ordered collection of static
text objects and entry field objects because that’s the way that a form will be
implemented. If this knowledge disposes the expert to ask users only those
questions dealing with choices of text and entry fields and the values that can
be placed in an entry field, the expert will miss potentially important behavioral
requirements. Behavioral requirements for a form might include identifying
itself, modifying itself, presenting itself (with the implication of multiple views),
completing itself (making sure every entry field contains appropriate values),
and validating itself. These are behaviors that will not be discovered by asking
about contents.
The initial focus of domain anthropology is on identifying stories and
some potential objects in the domain. Stories reveal both potential objects and
some of the “social relationships” among them. Human cultures have rules for
interaction among their members. People engage in a complex web of mutual
obligations that change with time and circumstance. People participate in
relationships, some fixed (such as biological parentage) and others temporary
(such as employer-employee). Similar social relationships exist among objects,
and they too must be discovered.
Chapter 7 Discovery 193
Details, and in some cases discovery, of some relationships will occur only
as attention shifts to defining tests and writing code (and the implicit design that
occurs simultaneously). The domain anthropologist (embodied in the on-site
customer working with technical developers) focuses on how and why objects
interact and, in some cases, why they do not interact—in other words, what rules
prevent a specific object from certain types of interactions with other objects.
How objects interact is mostly a matter of recording actual and possible
(desirable) conversations among objects. Why is mostly answered by seeking
the task or tasks that motivated the conversation. There are different ways to
organize the work required to solicit all the conversations and tasks relevant to our
understanding of the domain and of the objects we might have to build to operate
in that domain.
194 Object Thinking
User Role
Response 'A'
The
Request System
Response 'A'
Response
User Role
This same information about the objects in a domain and their interaction
can be modeled textually. The system request table (Figure 7-3) replaces the
stick figure diagram of UML, and the conversation table replaces the graphical
interaction diagram (Figure 7-4).
Figure 7-3 In this system request table, the service requester is identi-
F07MQ03
are noted at the top of table. Each line of the table shows who is making
a request, the nature of the request (message), the service provider, the
object returned, and a comment if necessary. The conversational order is
assumed to be top down.
1. The couple glances at the application to make sure it is the right one
(implicitly asking the application to identify itself).
Chapter 7 Discovery 197
2. The couple looks for the first blank spot (implicitly asking the appli-
cation for the next space needed to be filled in).
3. The couple asks what information needs to be placed in that spot
(implicitly asking the blank space for its label, on the assumption
that the label will describe the information needed).
4. The couple enters a value in the blank spot.
5. Steps 2 through 4 are repeated (next blank spot replacing first blank
spot in the description of step 2) until there are no more blank spots.
instantiate yourself
next
entry field
a field
instantiate yourself
value please
a value
validate
self
self
Figure 7-6 This interaction diagram depicts the alternative scenario for
F07MQ06
filling in an application.
Chapter 7 Discovery 199
Differences in the conversation are minimal, but they reflect the behavioral
parity of all objects—that every object, including humans filling the role of infor-
mation provider, are defined in terms of the services they can provide others.
Each object is an active entity in control of its own destiny. The alternative way
of thinking about the conversation also reveals objects that might not have been
discovered or thought about in the original model of the conversation.
More important, the thinking behind the alternative conversational model is
more general—more abstract—and therefore applicable regardless of the means
of implementing the application. Behavioral expectations of the application and its
parts are consistent whether implemented with paper or as a software application.
True, the software versions of the objects have more interesting or dynamic ways
of exhibiting behavior. An example is the entryField object using the services of a
blinkingCursor instead of simply displaying itself as a blank space.
The alternative model is also more consistent with user expectations of the
objects involved, which is the real goal of domain anthropology. If we are to
build digital versions of forms and entry fields, they should reflect the expecta-
tions of their naturally occurring counterparts. For example:
2. Reflects U.S. and Western culture. Other cultures use right-to-left and down before left-to-right
conventions.
200 Object Thinking
Object Definition
Semantic nets and stories (scenarios, use cases, interaction diagrams) provide
input, but the most critical aspect of discovery is object definition. Each object
must be identified in terms of its actual or intended use in the problem space—
the domain. The metaphor of domain anthropology continues to shape our
thinking about each individual object and what we expect of it in terms of services
(behaviors, responsibilities).
Each circle on the semantic net is a potential object. We can select any one
of them and attempt to identify all of the services such an object might provide in
its domain—in its domain, not just the application or specific problem where we
first encountered this object. It is true that object thinking is biased in that it expects
most objects to have limited and simple behaviors—which makes it possible to
model them in terms of an entire domain rather than an application. This bias is
supported by experience, but it is an inductive conclusion, and the exception or
exceptions may yet be found. Typically we would use the first two sides of the
object cube model to record our thoughts about the object and its behaviors.
Our goal during discovery is object definition, not object specification.
Definition means we want to capture how the object is defined by those using
it, what they think of that object, what they expect of it when they use it, and
the extent to which it is similar to and different from other objects in the
domain. Specification will come later (maybe 30 seconds later if you are doing
XP and working on a single object), when we allow ourselves to consider how
this object might be implemented (simulated) in software. Specification will
involve making some design decisions and capturing the information necessary
for someone to actually build the software version of the object.
Object definition involves capturing three bits of information: a short
prose description of the object (in the words of a domain user), an enumeration
of the services it is expected to provide (and, if other objects are used as helpers
for any given service, the kind of object to be used), and, when appropriate, a
stereotype—another object or other objects that the one we are working with
resembles in terms of similarity of services provided. Wirfs-Brock and McKean
Chapter 7 Discovery 201
Application [side 2]
A kind of form used to collect facts
necessary to make a leading decision
stereotype:
a Form
a Collection
(when computerized) an Interactive Form
stereotype:
an EntryField
Figure 7-7 Side 2 of the object cube for the Application and entryField
F07MQ07
We do the same thing for the entryField object, obtaining the information
shown in Figure 7-7.
We now turn our attention to the services we expect from our Application
and entryField objects. We have several choices of how to think about the ser-
vices. We can look at the arcs connecting the application circle to others on the
semantic net to see whether they suggest services expected of the application.
We can go over the story about filling out the application to see what was
expected of the application in that story. Either of these options is likely to
expose services that our application must satisfy, but those services might be
couched in specific language reflective of the limited context in which we dis-
cover the service rather than the domain as a whole. We will take care to gen-
eralize any such discovery so that the service reflects the needs of all of the
objects that might use our application.
A third way to approach the enumeration of services is simply to ask the
question, “I am an application; what services can I provide to others?” To help
us answer this question, we can look at an actual physical example of the appli-
cation form, and we can begin to collect those stories involving the application
that have been provided to guide our immediate development activities and
phrase the question in the context of each of those stories. “In this story, what
services do the other objects expect of me?” As your project evolves and as the
application object is discovered in other projects with other stories, you revisit
your thinking about the essential services that your object is to provide.
We notice that the application has a funny string of characters at the bottom
(something like AF001rev10/03), and we also notice a line of print at the top in
larger font size than the other contents. We surmise that these character strings
identify the form in some way. We also recall that the stories told about the
application implied that users of the application looked at it to confirm that they
had the right form. From this we conclude that the form has a responsibility to
identify itself. We record this information on side 1.
Visual inspection reveals several examples of short text strings and several
examples of blank spaces. We might give these things names—textString and
entryField, respectively—and then create a new object cube with those names
on them. We will want to explore those objects later to determine what their
responsibilities might be.
Our attention is on the application, however, so we wonder whether the
application has any responsibility in connection with these newly discovered
objects. It’s obvious that the application holds these elements in an organized
manner. We might arrive at a responsibility that the application holds elements.
We reject the phrasing holds elements because that does not describe a service;
instead, it describes something the application must do to provide a service. If
we say holds objects, we are implying an implementation decision: how an
object is to do something rather than what it is to do. A bit of thought, and we
Chapter 7 Discovery 203
come up with the responsibility provide access to elements. Implicit within this
responsibility are variations such as provide access to a subset of elements and
provide sequential access to elements. We might record these variations on side 1
so that we don’t forget them, even though we aren’t sure they are appropriate
responsibilities.
any elements the application contains that are displayable are the ones we
collaborate with to complete the application’s display responsibility.
The fact that the application is a container of other objects also suggests to
us a second stereotype for application. It has behaviors similar to a collection—
another type of container object. We should add this observation to side 2 of
our card.
One more responsibility needs to be considered. In one of our stories, it was
suggested that the application form needs to be verified or validated. The informa-
tion entered on the form—the information contained within the entryField
objects—must be confirmed. This would suggest a responsibility validate applica-
tion form. But who should this responsibility be assigned to? According to the pre-
cepts of object thinking, the application must be responsible for validating itself!
So we add one more responsibility to side 1 of the object cube, validate self.
Exactly how this is done we do not know. But a bit of reflection indicates that
part of the validation is done on the values stored in each entryField. The appli-
cation should not be validating the entryField; the entryField must be responsible
for that itself. Just as was done with the display responsibility, the application will
delegate to each entryField its share of the validation workload. We list entryField
as a collaborator for the validate self responsibility of the application.
Alas, our thinking may be leading us astray a bit in our consideration of
validation. Perhaps it is not one task but two similar tasks, one of which
belongs to the application and the other to the entryField. To be sure we are
doing the right thing, we need to ask what is meant by validation as that term
is used in the domain. So we might ask a user, “How is an application vali-
dated?” The user then provides a simple story about validation:
“Well, the data in each field is checked to see whether it’s the
right kind: a name, a date, a dollar figure, things like that.
Then we verify that the value is accurate and permissible. By
permissible we mean things such as the number entered in age
has to be between 25 and 40, or the number of years married
must be between 2 and 10. By accurate, we mean that the
income figure is verified with the employer. Also, the bank
balances, things like that. Finally, we check the application for
consistency. Say they enter a city name and a postal code. We
check to see that the postal code matches the city.”
Thinking about the story suggests that the application, as well as each
entryField, is validated by applying a rule or rules to the value stored in an
entryField. In the case of the application, the rule might have to look at values
stored in more than one entryField.
Our first attempt to implement this story might utilize a lot of If statements and
the hard-coding of a lot of values in the conditional checks of those If statements.
206 Object Thinking
If the names of fields on the form change or if the rule changes in some fash-
ion, we will have to fix the code. There is insufficient flexibility and too much reli-
ance on conditional code to pass the XP “smell test.” Applying the object thinking
principle—everything is an object—in thinking about how to refactor our code
should lead to the discovery of another kind of object—a rule object. A rule object
is given the responsibility to evaluate itself to some value (either the TRUE or
FALSE of this example or any other value). We can then provide the form and each
of its entryField objects with a rule (or rules) that it can use to effect its own vali-
dation. So we change both object cubes to reflect the newly identified collabora-
tor. We would also make a new object cube for the validationRule object.
When we are done, we probably have the object cube—sides 1 and 2—for
Application and for entryField completed as shown in Figure 7-8. Once we com-
plete sides 1 and 2 of an object cube for every object identified in our semantic
net, and once we have assured ourselves that we can tell any story the user can tell
us about using those objects, we are done. The overall result for the subsidized
mortgage company will be similar to Figure 7-9 (side 1) and Figure 7-10 (side 2).
Figure 7-8 Sides 1 and 2 of the Application and entryField object cubes.
F07MQ08
Class: MortgageApplication
Class: ValuedCollection Class: ValueHolder
Form, Object
Object Object Class: Bank Class: InsuranceAgent
return funding status
return cumulative value return keys
implement collection behavior return value at key return savings amount provide insurance premium
implement collection behavior return checking balance
return customer rating
return accounts for customer
Class: EntryField
Object Class: InvestmentCollection
Object, ValuedCollection Class: CalculationElement
Class: Home Class: Person
obtain value
validate self return periodic income
calculate self
return validation rules return sale price provide employer
return held class name return area provide bank
return legal description
Class: SelfEvaluatingRule
Object
evaluate self Class: Assessor Class: Couple
Payment Collection Mortgage Collection
F07MQ10
Description: Object Description: LIMT Description: Payment
Description: DataSourceInterface
root of class hierarchy this object represents the mortgage a document identifying a periodic
trust and functions as the "global" obligation to transfer funds and a representation and interface to an
object in many application programs. documents that transfer when it occurs. outside object from which objects in
our applications require information.
Object Thinking
Description: EntryField
Description: InvestmentCollection
Description: CalculationElement
Description: Home Description: Person
accepts and validates an entered bit
of information, can change its an instance of a valued collection
a kind of self evaluating rule for
validation criteria a representation of facts about a a representation of a human being
calculating part of a payment
dwelling
Description: SelfEvaluatingRule
Description: PaymentCollection
Description: MortgageCollection Description: Assessor Description: Couple
a rule that can reformulate itself by
adding and deleting elements and an instance of valued collection
resolve itself to a final value which <description unspecified> an instance of data source interface an instance of data source interface
it can report back
<description unspecified>
Chapter 7 Discovery 209
As you look at the figures, you’ll see objects that we have yet to discuss in
the text—objects that have come to light as other developers worked on their
stories. As the team works, objects will be proposed and developed by different
pairs, and you might not be aware of much more than the names of the objects
until you have the opportunity to work on a story involving those objects.
Object discovery provides us with a set of named objects and a set of
responsibilities assigned to each one. We might also have a short prose descrip-
tion of the object and a stereotype. In one sense, we are ready to code the
objects we have discovered, and that would be the expected activity of the XP
programming pair (coding tests first, of course).
Object thinking can still help you as you think about the code and start to
make implementation decisions. For example, we can use the stereotype to sug-
gest an existing object that might be modified or employed to help fulfill the
responsibilities of the one we are working on. This kind of implementation deci-
sion will give rise to a taxonomy of classes—a class hierarchy. Such a hierarchy
has several benefits for programmers: providing already written and tested code
that we can employ for our own ends and, because of the taxonomic organization,
a kind of index we can use to look for code that might be useful to us.
Chapter 8 will introduce some additional aspects of objects that we can
think about to facilitate our implementation—aspects that might be characterized
as design considerations. In Chapter 10, we’ll look at class hierarchies (taxono-
mies) in a bit more detail.
Another Example
Some Objects from an Air Traffic Control (ATC) System
Imagine we are working on modeling the world of air traffic control. We
will have identified a number of objects in that realm, including passen-
gers, airplanes, control towers, flight routes, controlled airspaces, and
many more. We will also have captured a number of stories about how
objects interact in this world. The following is a brief illustration of how a
few objects might have been modeled in such an example. We will focus
on the airplane and some objects that come to be identified as we con-
sider the airplane and its responsibilities. We will use the story of how an
airplane fulfills one of its responsibilities—reporting its location as the
background—for our process of discovery.
Figure 7-11 includes a depiction of side 1 of the object cube for an air-
plane. By identify self, we mean that the plane can provide its registration
number. Describe self entails giving a requester of that service an object
(continued)
210 Object Thinking
(continued)
Chapter 7 Discovery 211
instrument objects.
(continued)
212 Object Thinking
Heuristics
Implicit but perhaps not obvious in the preceding section (and in the sidebar)
are a number of heuristics for discovering and assigning object responsibilities.
There are also some points where the developers’ thought processes might
have proceeded in a different direction: there are different and equally valid
Chapter 7 Discovery 213
object designs. Some hints of why the examples shown are as they are can be
incorporated into the discussion of the heuristics.
Heuristic: Let objects assume responsibility for tasks that are wholly or
completely delegated to other objects in cases in which the responsibility
reflects natural communication patterns in the domain.
For example, the question might arise as to why the control tower asks the
airplane for a location instead of talking directly to a location object and hav-
ing it talk to the airplane’s instrument cluster. After all, it is the location that
actually does the work. If you are familiar with modern aviation, you know
that control towers have the ability to talk to at least one instrument carried by
an airplane—the transponder. This question raises a general issue of when an
object should or can assume responsibility for work actually done by others.
In the case of Airplane, it seemed a natural call. After all, the control tower
already has to talk to the planes (actually the pilots) about all manners of busi-
ness, so it doesn’t seem illogical for it to do so for location as well. The plane
is already “visible” to the control tower, and the plane provides the context of
meaning for the values that will be accumulated by the location object. It does
no harm to let the plane front for location, and it does a lot of good. Similarly,
there is value in letting the location object front for the instrumentCluster and
Instrument objects. If at some point in the future we have a more abstract
FlyingThing, we can use the same interface to obtain locations for any special-
izations of that class, such as the airplane. If the definition of location (the type
and number of values it contains) varies, the interface remains the same. If new
types of instruments are invented, they can be added to the instrumentCluster
without any need to know details about them—as long as they can respond to
the currentValue message.
method, stop! Think ahead a bit and reevaluate what you are doing. There is no
need to write ugly methods if a bit of foreshadowing can help you refactor as
you write. Decisions regarding responsibility assignment and method code are
seldom final; they are just a way to help you distribute responsibilities in a way
that minimizes, to some degree, future work.
Foreshadowing is not a substitute for refactoring and emergence; rather, it’s
a way to learn from experience and to apply XP and object thinking principles as
you work. For example, as you start writing the twentieth line of code for the
method you are currently working on, you should be hearing alarms—“This is
too hard”—that cause you to pause and see whether you can mentally imagine
what the entire method will look like and refactor the image of the code instead
of the actual code.
Anthropomorphization assists us in thinking about responsibilities and other
objects in several ways. We can think of objects as being “lazy” and wanting to do
only a limited and closely related set of activities. We find the responsibilities that
need to be delegated to other objects by foreshadowing what might be involved
in fulfilling a responsibility. We can think about how much the object might need
to know, whether it will need to know the “wrong” kinds of things about other
objects (that is, anything not evident in the object’s interface), and what it might
need to do.
perhaps) that it will not be willing to share with others and that therefore will
not be included in the interface for that object. Provide private key would not
appear as a service, although the message privateKey might be in the object’s
protocol with the designation that it is a private message. Decrypt message, on
the other hand, might be a listed responsibility. Always state your responsibili-
ties in terms of a service, with an awareness of a possible client for that service.
One advantage is flexibility. If you make the interface to your class depen-
dent on the characteristics it might need to report and someone decides on a new
characteristic, you will need to redefine your class. The alternative is to have a
Chapter 7 Discovery 217
Heuristic: Create proxies for objects outside your domain that are
sources of information required by objects within your domain.
In the process of completing both the binary use cases and the scenarios, a
number of objects that are outside your domain will be identified. Legacy sys-
tems and human beings are the most obvious examples. They continue to be of
interest and importance because they are sources of information or behavior that
your objects will require. These requirements will be exposed in the scenarios as
messages sent to these outside objects.
Note Some objects that appear frequently in your stories may turn
out, in fact, to be external objects or representatives of external
objects. For example, the airplane object in the air traffic control example
earlier in this chapter is really a kind of proxy for objects that are not
directly part of the ATC system itself. Real airplanes (their pilots,
really) are customers of the ATC and a source of information that the
ATC uses in fulfilling its responsibilities.
219
220 Object Thinking
Object Internals
Discovery has provided a decomposition of a domain into objects, an assign-
ment of responsibilities to those objects, and a description of how objects might
communicate and cooperate with one another to complete tasks beyond the
capabilities of individual objects. This is usually not sufficient information to
actually build computer software simulations of those objects and of those
interactions.
Here are some examples of why this is so:
■ Sides 1 and 2 of the object cube (and the classical CRC card) capture
only behavioral expectations of your objects—they tell you nothing
about the internal construction of those objects and nothing about
the means used by those objects to fulfill their responsibilities.
■ Assignment of responsibilities to an object tells you nothing about
how to invoke that responsibility and nothing about what form the
response will take.
■ Identifying a need for collaboration tells you nothing about how the
client object uses its collaborator, nor anything about how it knows
of the collaborator’s existence and location, nor anything about the
form of communication with that collaborator.
Chapter 8 Thinking Toward Design 221
There is a clear need to think about how your objects will be simulated, to
make decisions about construction (design). Those decisions must be guided
by the principles of object thinking and based on the intrinsic needs of the
object. An intrinsic need is defined as the means for fulfilling an assigned
responsibility. It’s necessary to discern additional information about our objects
and their needs. It’s inevitable that the process of determining this information
will involve making decisions about implementation, normally an activity asso-
ciated with design.
There are innumerable ways to implement even the simplest object or
object responsibility. Take, for example, obtaining the string that uniquely
identifies an object. Different languages provide different implementations
(object.id, the dot notation of Java and Visual Basic versus the id getter message
convention of Smalltalk); different groups set different naming conventions,
which necessitate different syntax; and even the nature of the “id” itself might
vary, in some cases being an object, in others a type.
While necessary, design decisions can impose unwanted limitations on
the ability to use an object in different contexts. This is reflected in the immense
difficulty involved in creating libraries of reusable components and the need for
extensive middleware anytime objects created in one context need to be used
elsewhere.
Keeping the object’s domain-assigned responsibilities in the forefront of
your thinking while making design decisions ameliorates design-based limitations.
For example, if you are designing an object for use in a database environment,
you might be tempted to implement the object so that its internal structure
mirrors the table structure of the database. This will limit the use of such an
object to that specific implementation environment—unless you employ middle-
ware or other kinds of interpreters and translators.
If, on the other hand, you continue to let your design be guided by the
domain and the behaviors allocated to an object by that domain, you can avoid
making decisions that will inhibit the natural composability of that object as it
exists in the domain. The following discussion attempts to illustrate the impor-
tance of domain-driven design while providing some guidelines for how to
accomplish it.
Knowledge Required
If we think of an object as if it were a human being (anthropomorphism) and
we give that object a task, it’s appropriate to think about what that object may
need to know to complete its assignment. We can use our understanding of
human beings and what they need to know to perform tasks as a metaphorical
guide for our thinking about object knowledge.
222 Object Thinking
For example, suppose we ask Sara to ride her bike to the store and bring
home some milk. She will need to know
Actually, the list of things required is potentially very large. A lot of the
items on our list are assumed to already exist—for example, how to ride a bicycle.
We have criteria (usually tacit) that limit our listing of what Sara needs to know
to a few details. We have similar criteria for considering what an object needs
to know to fulfill its responsibilities.
If we ask Sara to ride her bike, we probably already know she has claimed
that ability and we trust her in making that claim. If an object says it can identify
itself, we assume (trust) that the object has a method—a block of computer
code—that actually performs the identification service. We do not need to
explicitly list such abilities as required knowledge. (We will explicitly name the
methods themselves when we specify how an object’s responsibilities are to be
invoked, that is, when we specify a message protocol.)
We will usually assume that Sara knows which store to go to and the route
to take unless she has more than one option and it matters to us which option
she selects.
We will also assume that now means now and that the service is to be
performed immediately upon receipt of the request—again, unless we want
the option of requesting the service at a specified time or in a particular set of
circumstances.
Most of the time, we are interested in recording the information—
knowledge—required by the object in order to fulfill its advertised services.
Information is perilously close to being what we typically think of as data.
It’s therefore very easy to fall into the “computer thinking” trap of assuming
that knowledge required equals object data structure or object attributes.
Object thinking will help us avoid this trap.
The responsibilities recorded on side 1 of the object cube drive our thinking
about the knowledge required. Look at each responsibility, and ask what the
object will need to know to fulfill this task. List your answer—as a descriptive
noun or noun phrase—on side 4 of the object cube. Figure 8-1 shows sides 1
Chapter 8 Thinking Toward Design 223
and 4 of the airplane object cube introduced in the “Another Example” sidebar
in Chapter 7, “Discovery.”
Airplane (1)
id self
describe self
report current location instrumentCluster
move to new location
Airplane (4)
id (v) a String
description (v) a ValueHolder
instrumentCluster (v) an Object
new location (A) a Location
current location (c) a Location
Figure 8-1 Sides 1 and 4 of the Airplane object cube, showing the
F08MQ01
How did object thinking lead to the results recorded on side 4 of the
object cube for the airplane?
In most cases, the list of knowledge required will be fairly short and rea-
sonably obvious. In some cases, a single responsibility might yield more than
one piece of required knowledge.
224 Object Thinking
(continued)
Chapter 8 Thinking Toward Design 225
An object has any of four different ways to gain access to the knowledge
it requires:
■ Objects are lazy. Every time you decide to store a piece of required
information in a variable, the object must assume responsibility for main-
taining that variable; it must add the capability to retrieve and to update
the contents of that variable upon request. So whenever possible and
appropriate, use argument (A) and method (M) instead of variable.
■ Collaboration is a form of dependence. Deciding to use a collaborator
to obtain required knowledge makes you dependent on that collab-
orator. Objects strive for independence, so collaboration should also
be minimized to the greatest extent possible.
■ Remember the definition of collaboration—requiring the service of
an object not found inside your own encapsulation barrier, which
will eventually require direct or indirect coupling with that collabo-
rator object. (With direct coupling, you know the actual name or ID
of the object used as a collaborator, whereas with indirect coupling,
you know where to find the object—in a global variable, perhaps.)
Coupling of this sort is just as undesirable in object thinking as in any
other development method or approach.
226 Object Thinking
Figure 8-2 Sides 1 and 4 of the objects (classes) introduced in the ATC
F08MQ02
Figure 8-3 shows side 1 of the objects in the mortgage trust application
discussed in Chapter 7, and Figure 8-4 shows the knowledge required for those
objects.
Message Protocol
Side 1 of the object cube tells us what an object can do but reveals nothing
about how to ask for the advertised services. We know from object thinking
in general that services are invoked by the sending of a message to the object
providing the service, but what form must the message take? This is not a trivial
question because the form of the message is arbitrary, but it must be exact, or
the receiving object will ignore it. (Actually, it will cause an error if the message
is wrong—a variation of “I haven’t the foggiest notion what you are asking
me to do.”)
228
F08MQ03
Class: Object Class: LIMT Class: Payment
Object Object Class: DataSourceInterface
display self Object
fund mortgages calculate self
id self invest surplus return calculation amounts return parsed value
persist return expense total indicate value change
grant access return surplus total implement collection behavior
Object Thinking
Class: MortgageApplication
Class: ValuedCollection Class: ValueHolder
Form, Object
Object Object Class: Bank Class: InsuranceAgent
return funding status
return cumulative value
return keys
implement collection behavior return savings amount provide insurance premium
return value at key
implement collection behavior return checking balance
return customer rating
return accounts for customer
Class: EntryField
Object Class: InvestmentCollection
Object, ValuedCollection Class: CalculationElement
Class: Home Class: Person
obtain value
validate self return periodic income
calculate self
return validation rules return sale price provide employer
return held class name return area provide bank
return legal description
Class: SelfEvaluatingRule
Object
evaluate self Class: Assessor Class: Couple
Payment Collection Mortgage Collection
Figure 8-3 Object classes from the mortgage trust application introduced
Expense Collection
F08MQ04
Knowledge Required: Object Knowledge Required: LIMT Knowledge Required: Payment
current display: aFrame Argument Knowledge Required: DataSourceInterface
expenses: aMoney Method calculation elements: aCollection Variable
id: aString Variable surplus: aMoney Method segmentation rule: aSelfEvaluatingRule Variable
calculation item: aString Argument
diskAddress: aDiskAddress Argument amountOnHand: aMoney Variable state: anEvent Variable
changedState: aBoolean Variable income: aMoney Method view: aView Variable
description: aValueHolder Variable myExpenses: aCollection Variable returnable elements: aCollection Variable
changed: anEvent Method my income sources: aCollection Variable
application: aMortgageApplication Argument
amount to be funded: aMoney Method
Knowledge Required: Form Knowledge Required: Collection Knowledge Required: Mortgage Knowledge Required: Investment
Knowledge Required: Employer
my entry fields: aCollection Variable added element: anObject Argument application: anApplication Variable periodic income: aMoney Collaboration
my validation rules: aCollection Variable deleted element: aString Argument couple: aCouple Variable current value: aMoney Collaboration employeeId: aString Argument
selected criteria: aCriteria Argument home: aHome Variable base value: aMoney Variable weeks worked: anInteger Variable
status: aCharacter Variable gain/loss: aMoney Method wages: aMoney Variable
terms: aCollection Variable investment id: aString Variable employees: aCollection Variable
my exchange: anInvestment Variable
We also have no clue about the way the object will respond to any request
sent its way. Will it provide us something in return? In many cases, we hope so.
If it does, what will be the nature of the returned item?
To answer these questions, we use side 5 of the object cube to record a
message protocol—a list of messages and their associated responses. As with
knowledge required, we refer to side 1 to elicit the necessary list of messages.
We also apply whichever idiom and convention for message syntax that’s
employed in our development environment. As individual messages are
recorded, care must be taken to maintain consistency with decisions made else-
where on the object cube—notably the names and encapsulating objects noted
on side 4 (knowledge required).
Figure 8-5 shows side 1 (responsibilities) and side 5 (draft message protocol)
for the objects in the ATC example. Figure 8-6 and Figure 8-7 show, respectively,
side 1 and side 5 for the objects in the mortgage trust example.
Figure 8-5 Sides 1 and 5 of the objects in the ATC example introduced
F08MQ05
Class: MortgageApplication
Class: ValuedCollection Class: ValueHolder
Form, Object
Object Object Class: Bank Class: InsuranceAgent
return funding status
return cumulative value return keys
implement collection behavior return value at key return savings amount provide insurance premium
implement collection behavior return checking balance
return customer rating
return accounts for customer
Class: EntryField
Object Class: InvestmentCollection
Object, ValuedCollection Class: CalculationElement
Class: Home Class: Person
obtain value
validate self return periodic income
calculate self
return validation rules return sale price provide employer
Chapter 8
Class: SelfEvaluatingRule
Object
evaluate self Class: Assessor Class: Couple
Payment Collection Mortgage Collection
Figure 8-6 Responsibilities for the objects in the mortgage trust application
Thinking Toward Design
231
232
F08MQ07
Draft Message Protocol: Object Draft Message Protocol: LIMT Draft Message Protocol: Payment
Draft Message Protocol: DataSourceInterface
id expenses calculate
id: aString amountOnHand amountAt: aString value
persistAt: aDiskAddress surplus segmentationRule: aSelfEvaluatingRule
busy income segmentationRule
displayOn: aFrame expenseCollection state
Object Thinking
Figure 8-7 Message protocol for the objects in the mortgage trust application
Chapter 8 Thinking Toward Design 233
the variable name itself as the getter and the variable name plus
argument as the setter; and to append the word get or set to the
variable name. (Example for the id variable: id and id: aString—or
getId and setId.) The argument, if any, will reflect whatever deci-
sion we made on side 4 as to the nature of the encapsulating object
for that variable.
■ Some messages are imperative commands: “Don’t bother giving me
anything back; just do this!” In those cases, no object is returned. A
Smalltalk convention is to note self as the object returned. For those
more familiar with C++ and Java, it is perfectly appropriate to put
the term void in place of self. The meaning is equivalent, although there
are still technical differences as to what, if anything, is actually returned.
Message Contracts
Side 3 of the object cube has not been forgotten—it’s only now that it will
make some sense to talk about what’s recorded on that face of the object cube.
That side 3 is not swapped with side 5 is a historical artifact: the idea of con-
tracts precedes the idea of object cubes. A contract is a concept introduced by
Rebecca Wirfs-Brock and her coauthors as an extension of the information
recorded on the original CRC cards invented by Beck and Cunningham. The
idea was to aggregate responsibilities—later, messages—into groups to reflect
the users of those methods. This particular use of contracts did not gain wide
acceptance, and the idea of contracts became rather obscure. Even so, the pro-
gramming concept of interfaces and templates has much in common with the
idea of contracts.
A concept from programming—message scope or visibility—provided
renewed use for contracts. In a programming language such as Java, methods
(and their invoking messages) could be designated public (anyone can send that
message and invoke that service), private (only the object itself can send the mes-
sage to itself), and protected (only a designated group of user objects can send
the message). Other languages, most notably Smalltalk, did not make explicit
provision for such method/message declarations. Using contracts to at least specify
the intent of the object developer as to the proper use of messages was a natural
extension of the notion of contracts. If the implementation language supported
message scoping, side 3 provided a specification to the programmer. If not,
side 3 documented the intended use of the categorized messages—and no good
object programmer would misuse private or protected messages. (Smile.)
As class libraries grew in size and the messages associated with individual
classes grew in number (something that should be minimized if object thinking
guides the design of those classes), it proved useful to create subcategories
Chapter 8 Thinking Toward Design 235
Figure 8-8 Contracts for all classes in both the ATC and mortgage trust
F08MQ08
F08MQ09
Events Generated: LIMT Events Generated: Payment
Events Generated: DataSourceInterface
busy bankrupt past due
changed insufficient amount unavailable
Events Generated: Form Events Generated: Collection Events Generated: Mortgage Events Generated: Investment
Events Generated: Employer
completed valueChanged
side 6). Note that most objects have no events. In some cases this is because they are
Figure 8-9 Events for objects in the ATC and mortgage trust examples (object cube
inherited (MortgageApplication from Form), but usually it just reflects that most objects
are not willing to share much state information, except for the almost universal
237
238 Object Thinking
Here are some important caveats concerning object state and side 6 of the
object cube:
■ Side 6 records only those states that the object is willing to make
visible to other objects. In this sense, side 6 is akin to side 1 in that it
publishes part of the object’s interface: the part of the object visible to
others. Some state changes might be kept private to better reflect the
domain being simulated by the object. For example, a selfCalibrating-
Instrument might have a state, out of calibration, that it does not
make visible to the outside world. Instead, it detects that state itself,
takes steps to correct that state, and only if it fails in such attempts
does it generate a public state, failed. Failed would appear on side 6
of the object cube, but out of calibration would not.
■ State changes are visible only to the object experiencing the change.
Many objects will choose not to allow anyone to be aware of their
changes, and even if an object does make a change public by list-
ing that state on side 6, it does not imply that you—or any other
object—can see that change, only that you—and all other objects—
can request to be notified when the object detects the change
in itself.
■ Side 6 of the object cube does not capture and is not intended
to capture state-related constraints on an object’s behavior. That
kind of information is captured in a static diagram—specifically a
state chart—and will be discussed in Chapter 9, “All the World’s
a Stage.”
■ Advertising a willingness to notify others of state changes implies
that the object has a mechanism for keeping track of who is to be
notified, how, and for what. At first this implied requirement might
seem to violate object-thinking precepts, but it’s quite possible to satisfy
such a requirement in a manner consistent with object thinking. The
mechanism is an eventDispatcher object. Every object capable (and
willing) of notifying others of its state changes must contain an event-
Dispatcher to effect that notification.
Event Dispatcher
Event Registration Queue
event 1 [REG1] [REG2]
event 2 [REG1]
event 3 [REG1] [REG2] [REG3]
event 4
event 5
Registration
[ receiverObject message ]
Registration (if priority allowed)
[ receiverObject message priority ]
We can then allow the collection that makes up the second column of the
eventDispatcher to be a sorted collection. As eventRegistration objects are
added, they are sorted according to their priority values. (Event dispatching
as described here is consistent with the observer/publish-and-subscribe
patterns published elsewhere.)
Object Appearance
It would be difficult to talk about objects without talking about the graphical
user interface (GUI). The Star project at Xerox PARC simultaneously advanced
local area networking, GUI design, Smalltalk (object-oriented programming),
and alternative input-output (I/O) modes (notably the mouse). Networks and
I/O were sufficiently esoteric and close to hardware design that they went
their separate ways, post-PARC. GUI design and objects, however, emerged so
tightly coupled that it’s often assumed that the primary (if not exclusive) use
of object design and object programming is the construction of graphical
interfaces.
Visual development environments (such as Microsoft Visual Basic) man-
aged to convey the impression that objects were the same as the GUI widgets
that appeared in the interface design toolbox. Once you had those widgets in
place on your form object, you did real programming—sans objects. (Yes, it’s
true that the objects are still there, but they are not emphasized or enforced,
with the net effect that most Visual Basic programs tend to be event-driven
procedural in nature and not OO.) Even Smalltalk IDE tools such as Parts (an
extension for Digitalk Smalltalk) and VisualAge (IBM) emphasized the utility
of objects for GUI building with far less emphasis on the objects behind
the interface.
A worse error was propagated when many of the early tutorials on object
programming introduced a misconception by suggesting a “method” colloquially
referred to as “cocktail napkin design.” It was suggested that the correct way to
design an application was from the interface in; that is, sketch your interface on
a cocktail napkin and then find the objects necessary to implement that inter-
face. The GUI became a straitjacket to which objects had to conform. This, in
effect, meant that object design and implementation were little more than the
hard-coded reflection of the specific and idiosyncratic design of a set of visual
interfaces. Change the visual interface, and you had to change the object. Not
only did this make for a lot more work, it meant that objects were not reusable
in different contexts if those contexts defined visual interfaces in an alternative
fashion.
Chapter 8 Thinking Toward Design 241
Note “You can’t emphasize this point enough,” suggests Ken Auer,
speaking about the danger of “GUI-in” design. “In my early days of OO,
if you talked to someone who had been using Smalltalk for 1 to 3 years,
you could almost rely on the fact that they ‘got it.’ After the advent of
Parts, VisualAge, and (to a slightly lesser extent) VisualWorks, I had
many interviews with programmers who had been ‘programming with
Smalltalk’ for 2 or more years and didn’t realize there were supposed to
be some objects other than the GUI and the database. Even the ones
that recognized this tended to have a poor handle on how central the
domain objects should be because they probably spent a good two-
thirds or more of their time dealing with GUI and/or DB issues.” Ken’s
comments support a basic premise of this book: object thinking is most
easily corrupted by reverting to old, familiar forms of thought. Laying out
widgets on a form and objects as data entities are but two examples.
Even the simplest object might have multiple representations of itself, just
as you probably have more than one photograph of yourself. A character, for
example, might have a boldfaced appearance and an italicized appearance. In
cases in which an object has multiple appearances and can be asked to switch
from one to the other, it’s necessary to add messages to the protocol that make
this ability evident. For example, a date object might have two messages in its
protocol—displayUS and displayEurope—the difference between the resulting
display being a transposition of the day and month values.
Most objects are compositions of simpler objects. Remember that every
instance variable an object might have contains another object. If an object with
instance variables has a gestalt (view of the whole) appearance, that gestalt is nec-
essarily a composite of the appearances of itself and all of its contained objects.
It’s easier to illustrate ideas about an object having multiple appearances
by using visual metaphors. But visual representations are not the only appear-
ances an object might have. Imagine an object that needs to store itself in a
relational database. The relational database management system (RDBMS)
cannot accept the object in its natural glory, so the object must marshal1 itself
into a stream of bits that can be accepted and held by the RDBMS. The resultant
stream of bits constitutes an appearance of the object but is not the object
itself, any more than a visual representation is.
Glyphs
The application of object thinking to the issue of text characters, numbers,
and graphical symbols should lead to the recognition that all of these are
really just instances of a single kind of thing: a glyph. A glyph object
would have one major responsibility: to display itself. To fulfill that
responsibility, it would need to know
(continued)
1. Marshaling involves the object taking itself apart, asking each part to convert itself into bits, and then
asking each part to line up in some kind of order. The process is analogous to a modem converting
an analog signal to digital (and eventually back again).
Chapter 8 Thinking Toward Design 243
Glyphs (continued)
The message protocol for a glyph would include the display message
(the glyph would use values in all the appropriate variables to create
the bit stream sent to a printer or graphics card that actually generates the
display) and getter and setter messages for each of the instance variables
listed in the foregoing list.
If glyphs existed in typical information system applications, it would
not have been an issue when a certain rock star changed his name to a
Celtic-Egyptian symbol.
(continued)
Chapter 8 Thinking Toward Design 245
247
248 Object Thinking
■ Constraints, keeping objects from doing things that they are capable
of but that we want to prevent in certain circumstances
■ Implementation, providing detailed information about the inside of
our objects; algorithms to be used and detailed specifications about
formats and values of information
The first three categories were deferred because they do not inform us
about objects, only about contexts in which objects must operate. Implementa-
tion issues are deferred in accordance with the long-standing development rule,
“Figure out what must be done before you concern yourself with how it is
done.”
We are also being consistent with the Lego brick metaphor: separating the
problem of creating bricks from the problem of building things with bricks. To
reintroduce another metaphor, we separated our discussion of actors and their
intrinsic talent from the discussions of casting, screenplays, and direction. Our
goal was to create actors (objects) with the versatility required to assume many
different roles in a wide variety of genres and to avoid creating objects that
were typecast—doomed to play the same role, in the same screenplay, over
and over again.
Generally, we do not try to solve all the problems of the world in one fell
swoop. Instead, we arbitrarily set a boundary that delineates our focus and sep-
arates it from the rest of the universe. We call this bounded space our “system,”
or our “application,” or our “program,” or our “object.” Unfortunately, we also
tend to be a bit sloppy in our use of terminology and frequently use the terms
application, system, and program more or less interchangeably. In the rest of
this section, I will use the term application as a label for the domain and our
artificially bounded portion of that domain and the term application artifact for
specific instances of executing code—programs or objects. (To see the differ-
ence between application and application artifact, see the sidebar “Systems
and Artifacts.”)
Chapter 9 All the World’s a Stage 249
■ Almost all of the objects you will ever need are already defined,
and already have behavioral expectations associated with them,
in the domain.
■ Almost all of the requirements of new development arise from
a misalignment of behaviors and objects. Misalignment results
when the wrong object (or group of objects) is providing a par-
ticular service, a service is more appropriately provided by a sil-
icon-based object simulation instead of a carbon-based
biological object, or, occasionally, no existing object is capable
of providing the needed service.
Static Relationships
There are an open-ended number of possible relationships among objects.
Some are so common as to have special notation invented for them in modeling
tools (UML, for example): using, is-a-part-of, is-a-kind-of, and contains are
examples of common relationships.
From this large set of possible relationships, only two tell us anything
about the intrinsic nature of our objects. All of the others provide information
about the context—the application—in which our objects operate; they are sit-
uational relationships. The two relationships that describe intrinsic aspects of
objects are is-a-kind-of and collaborates-with.
Is-a-Kind-of Relationship
Classes are not essential to object thinking, merely a convenience. From a cog-
nitive standpoint, the use of classes allows us to think about an entire group
instead of all the members of that group—something we have been doing
throughout this book.
Combining the idea of classes with the is-a-kind-of relationship yields a
taxonomy, a particular kind of structural organization, that can then be used as
a kind of index to help in finding an object with a particular set of behaviors.
Figure 9-1 is a class hierarchy diagram—specifically, a taxonomy of the classes
in the mortgage trust example introduced in Chapter 7.
252 Object Thinking
Object
Form Valued
Collection
DataSource Investment
Interface
Collection Mortgage
LIMT ValueHolder
Mortgage
Application Payment Self EntryField
Evaluation
Expense Investment
Calculation
Collection Collection
Element
Bank Home
Insurance Assessor
Agent
Figure 9-1 The is-a-kind-of relationships among the objects (via their
F09MQ01
Collaborates-with Relationship
Collaborations arise if, and only if, object A must use a service from object B
during the interval defined by object A receiving a message (request for service)
and object A returning the appropriate result object to the sender of the mes-
sage to object A. All collaborations are synchronous in the sense that object A
must invoke and wait for results from object B before it can complete whatever
work is required in response to the message it received.
Collaborations are almost always hard coded: they require manifest refer-
ences in the algorithm of the method where the collaboration occurs. Because
of the hard-coded nature of collaborations, we assert that they define part of the
intrinsic nature of an object. In every circumstance, in every context, the collab-
oration will occur if object A receives the indicated message.
Collaborating objects are very tightly coupled. For this reason, collabora-
tions should occur inside the encapsulation barrier, with objects occupying
instance variables, objects being received along with messages, and objects
occupying temporary variables. Collaborations with objects occupying global
variables are good or bad depending on the justification of need for a global
variable. Collaborations outside the encapsulation barrier are sometimes neces-
sary but should be avoided (by refactoring the distribution of responsibilities
among objects) whenever possible.
Wirfs-Brock introduced a dedicated model—a collaboration graph—that
was seldom adopted by actual developers. Figure 9-2 shows an example of
such a graph. The graph depended on the use of contracts (side 3 of the object
cube) to define potential connection points for potential collaborations. Deci-
phering the graph was difficult because of line tracing from client to server. Col-
laboration graphs (probably unintentionally) provide a visual metaphor
consistent with the object = software integrated circuit introduced by Brad Cox.
Interesting collaboration graphs look like circuit boards when viewed as a
gestalt.
Chapter 9 All the World’s a Stage 255
31 32 19 5
View Outline
Element Element
18
34 35
31 32 33
19
5
Outline
Galley
View
View
Displayable
Printable View Object Document
Document Subsystem
Text
View
View
D
Text Graphic
Element 9
Document
Variable Element 10
3 Date Text 26
30 Time Paragraph 22 E
Page Graphic
20 12
Number Paragraph
1
Text F
27
Text Paragraph
G
Character
16 14
H
Heading
16 Link
Composable Object I
Document Display 4
6 7 8
Frame
A B
17 11 29 2
Situational Relationship
Collaborations are not the only example of “uses” relationships among objects.
It can be said that object A uses object B if object B has asynchronously pro-
vided information or services to object A that object A finds useful for its own
work. For example, an airplane has a responsibility to identify itself, which
requires an id object, which leads to the assumption that at some point in the
past the airplane asked some national naming authority for an id object. That
request for an id object is an example of a uses relationship between the air-
plane and namingAuthority. (It is not a collaboration because the airplane does
not interact with namingAuthority each time it receives the id request.)
Except for collaborations, the fact that particular objects use the services of
others reflects the demands of the application (the situation) and not intrinsic
needs of the objects themselves. The same thing can be said of the particular
objects that are aggregated into components: the aggregation is a reflection of
the demands of a particular circumstance, nothing more. This is not to say that
it is unimportant to understand (and probably model) situational relationships,
but it is important to recognize, and keep in mind, that you are not modeling
the intrinsic nature of any objects.
What then do you need to understand about a situational relationship
application?
2. Roads connecting cities are obviously real. But the existence of a road does not mandate use by
vehicles; traffic remains a potential, not a certainty.
258 Object Thinking
Figure 9-4 shows an SRM for the mortgage trust example. Notice that it is
very similar to the semantic net: most of the same players are still present, and
most of the links among them are still evident as well. It differs from the seman-
tic net in the use of implementation names for many of the objects (classes), it
shows some of the interesting details of object construction (instance variables
and method names), and it uses terminology more suitable for implementation
than discovery. (Technical rather than domain jargon is allowed on an SRM but
not on a semantic net.)
Chapter 9 All the World’s a Stage 259
accesses
Employer
accesses
Bank
completes accesses
Couple Assessor
uses DataSource
Interface
contains
Mortgage EntryField uses
Collection SelfEvaluating
accepts Rule
is-for-a
funds has Payment
LIMT
Mortgage Collection
has
contains
is-for-a
Investment
Collection uses
Payment Calculation
Home
Element
Figure 9-4 SRM depiction of the classes and relationship in the mort-
F09MQ04
Figure 9-5 shows a fragment of an SRM that relates the three objects under
discussion. This fragment obscures a great deal of detail about the actual rela-
tionships involved—for example, the following rules:
Figure 9-7 depicts a collective memory map for the mortgage trust example.
Collective memory maps are situational: they reflect constraints that exist
among “data” objects in the context of a particular application. In some cases,
it might be useful to create a domain-level version of a collective memory map.
A domain-level collective memory map would have some things in common
with an enterprise memory model, namely a global depiction of all the “data” in
the domain and the objects in which it might be found and any relationships
among those objects that were truly invariant across the domain. If your enter-
prise is interested in constructing such a global model, you need to remember
some important caveats:
■ Object thinking presumes that “data” objects represent information
or knowledge that objects need to perform their assigned tasks,
while enterprise data models presume to depict all the data that the
“system” must remember about objects. This is a critical distinction.
Chapter 9 All the World’s a Stage 263
Employer.weeksWorked MortgageApplication.status
Mortgage.status
Employer.wages
Investment.current.Value
LIMT.amountOnHand
Investment.id Neighborhood.medianPrice
Person.bank Home.salePrice
Bank.customerRating
Couple.marriageDate Application.Contents
Home.location
contains contains
Application.contents.home
matches
Application.contents.marriageDate Home.legalId
Figure 9-7 A collective memory map for the mortgage trust example.
F09MQ07
Architecture
Almost all applications have an overarching structure or means of organization,
which might be called architecture. Architecture affects the way you think
about implementation, especially when the architectural pattern is so common
as to be assumed. For example, traditional structured development presumed a
hierarchical command-and-control architecture as reflected in a program struc-
ture chart (Figure 9-8). This visual pattern is seen in the mainline-plus-subrou-
tines source code organization scheme (Figure 9-9). The hierarchical control
architecture is a codification and expression of a lot of ideas about “good” pro-
gram design, ideas that support most of the rest of structured development
approaches.
264 Object Thinking
Master Control
Module
Initialize procedure
Main routine
Input data routines
conditional flow logic
end input routines
Process data routines
case statement depending on data types
end process routines
Output routines
conditional flow logic
end output routines
end main routine
Termination routine
subroutine one
transform code
end subroutine one
subroutine two
transform code
end subroutine two
Figure 9-9 A structure depicting how actual source code might reflect
F09MQ09
Figure 9-10 Objects move along the route provided by the pipes and
F09MQ10
(continued)
266 Object Thinking
3. Gelernter, David. Mirror Worlds. Oxford University Press, Reprint edition (January 1993).
268 Object Thinking
Application
Application View
Dispatcher
Application Object
composite w/
w/ application
application’s
dispatcher
object-object
dispatcher
composed of
object views Object-View
Dispatcher
Composite
object view
Object-Object
Dispatcher
Object-View
Dispatcher
Object View
Object-View
Dispatcher
One of the model objects assumes the role of the application object. The
application object assumes responsibility for startup and shutdown activities in
collaboration with the other model objects and acts as a kind of global (within
the application) repository of objects and information that need to be visible to
other model objects while the application is running.
The view consists of a hierarchically organized collection of objects—for
example, widgets, windows, and icons—whose primary task is creating visual-
izations of objects so as to be comprehensible to human beings. This definition
presumes a GUI environment and reflects the history that shaped the original
MVC architecture.
A view object does not have to be a GUI element. If an object creates a rep-
resentation of itself other than its native implementation, that too would be a
view object. Examples of nonsensory views would include bit stream serializa-
tions that allow objects to exist in a relational database or an XML statement that
allows an object to be shared across applications and implementation languages.
In Figure 9-12, view objects are depicted as rounded rectangles. The hierar-
chical organization of views reflects the fact that simple objects have simple views
and more complicated objects have views that are collections of the views of the
simpler objects that they comprise. It’s also possible for any object to possess
multiple views of itself. An integer, for example, might have a simple bitmap
view that depicts the value of the integer, and it might have an update view
consisting of a widget depiction (rectangular entry field area) plus the bitmap of
its value. Figure 9-13a illustrates the hierarchical composition of a complex
view, and Figure 9-13b provides an example using the mortgage application.
Object1 View
Application Object
Object3 Object1
view
Object2
composite view
Object4 Object3
view
Object4
Object2
Application View
Customer
Object
widget3 registration
Obj2
Obj5
Obj6
that the client knew what it was asking for and had a use for the result. This is an
anthropomorphic way of saying that objects are not and should not be aware of
their clients, even when those clients are not other software objects.
The application object, or one of its cast members, might require services
from objects in the outside world. In that case, it might need to display itself
using an update view, an implicit request to an outside world object to provide
information by altering the update view. In other cases, it might need to find
and send a message to an object in the outside world, usually by sending a
message to the operating system object via the application object.
A composite eventDispatcher associated with the application object also
handles events generated in the outside world of which objects inside the appli-
cation (or the application object itself) might need notification. In Figure 9-12,
the application dispatcher has three parts (view-object coordination events, out-
side world events, and global notification events) illustrating its composite
nature.
The MVC architecture has been criticized (in some cases by those who
created it), but it is an excellent example of how to organize and coordinate a
group of objects without imposing any kind of centralized control. The distri-
bution of responsibilities and the creation of special-purpose objects such as
the dispatchers allow complete flexibility, even at run time. Dispatcher events,
for example, can be added and deleted by sending a run-time message, as can
registrations for those events. It’s even possible to dynamically configure the
event registration dyad at run time. MVC provides an existence proof of how
the ideals of object thinking can be realized.
Dynamic Relationships
All of the static relationships (except class hierarchy and collaboration) can be
seen as “setting the stage” information. They determine the scenery and props,
the marks that actors use to navigate the stage, the cast of characters, and an
outline of the plot. A script actually determines what happens on the stage dur-
ing the performance of the play. A script is simply a collection of messages sent
from actor to actor, interpreted by receiving actors, and resulting in subsequent
messaging. On occasion, actors respond to cues other than messages—that is,
signals, such as the ringing of a phone, which is the phone’s way of notifying
other objects of a change in its state.
Capturing and modeling the dynamics of an application (following the
stage metaphor) consists of detailed modeling of scripts and event notification:
the two sources of “cues” for our participating objects.
274 Object Thinking
Scripts
During discovery, we told stories about object interactions. Some of those sto-
ries we wrote down on cards; others we modeled with interaction diagrams.
Most of those stories exhibited a nested structure, analogous to the way a play
is broken up into acts and acts into scenes. Design and implementation activities
require that we turn those stories into specifications, program code, or both.
The same tool, an interaction diagram, is used to discover conversational
requirements and specify a script. The only difference will be in the labels
attached to objects, messages, events, and returned objects. During discovery
we want to use, exclusively, domain language in describing our stories. For
design purposes, our diagrams should have labels that correspond to actual
classes and actual messages as they appear in message protocols recorded on
the object cubes. (In the Behavior! tool mentioned earlier, interaction diagrams
have color-coded labels: red meaning that the label has not been mapped to an
implementation term and reflects user vocabulary, black for user vocabulary
that has been mapped to an implementation term, and blue for the implemen-
tation term. The diagram itself does not change, only the labels, assuring con-
sistency between our domain and the simulation of that domain we are creating
in software.) Figure 9-15 depicts the discovery and script versions of a conver-
sation from the mortgage trust example.
Figure 9-15 The diagram on the left has labels reflecting domain vocab-
F09MQ15
ulary. The one on the right is the identical conversation with labels reflect-
ing implementation vocabulary.
Figure 9-16a The original story that, whenever it looks as though a lot is
F09MQ16a
4. An XP story has three parts, card, conversation, and confirmation. The card is the tangible evidence
of the story and a place to record information about the story (estimate and priority, for example). The
conversation may be verbal or may involve the use of diagrams such as those depicted here. The con-
versation is intended to expand understanding and to reveal the design behind the story. Confirmation
is the acceptance test, written by the user and implemented by the developers, that proves the code
accomplishes the desired task.
276 Object Thinking
Event Dispatching
Events are cues that can be used by the developer to script object interactions.
Side 6 of the object cube lists the events (cues) available for use. Our stories
and the interaction diagrams that might have been created as part of the con-
versation about those stories provide us the information needed to link an
event (cue) with resulting messages sent to the objects being cued. The object
cube tells us of the state changes an object deems of potential interest to others,
and the interaction diagrams note occasions when state changes affect the flow
of a conversation among objects.
The interaction diagrams also confirm an important aspect of object think-
ing: the only object directly aware of a state change is the object in which the
change occurs. The double-headed arrow used in an interaction diagram to
denote a state change signal must always be directed to the object in which that
state change occurs, never to other objects in the diagram. Figure 9-17 illus-
trates this important caveat.
278 Object Thinking
other objects. A state change can trigger multiple messages to other objects,
reflecting the contents of the event dispatcher, as shown in the diagram on the left.
State Modeling
Figure 9-18 shows a state diagram for a mouse and part of a diagram for a
mouseManager object. (mouseManager is a name reflective of a popular oper-
ating system environment—not of object thinking.) The dotted line in the
5. Some of these registrations will be made as part of the application initialization process—getting the
cast (objects) ready to perform—and others will come and go during the running of the application.
Chapter 9 All the World’s a Stage 279
Figure 9-18 This Harel state chart depicts a mouse and its composite
F09MQ18
Figure 9-19 Partial charts for application and entry field, from the mort-
F09MQ19
Constraints
We have a stage, actors, and a script (application context, objects, and a script
object plus populated event dispatchers); and the play (application) is ready to
open. Except … sometimes our actors have to obey rules or are otherwise con-
strained in their actions. We need to accommodate this need as well.
Objects, like people, can have behaviors that should not be exercised in
certain circumstances. All constraints are local and arbitrary (for example, the
rules of culture that allow one behavior in one place but not another), and
because of this, the modeling and the implementation of constraints are not
intrinsic to the definition of objects, only to the context (application) in which
those objects perform at any given time.
Classical thinking about object development made this difficult, primarily
because rules and constraints were primarily seen, and modeled, in terms of
static relationships between or among objects. Because these relationships
were supposedly static, they tended to be hard coded in object designs and
implementations.
With a few exceptions, object thinking suggests that constraints and rules
should be thought of as objects in and of themselves. We have talked in this
vein throughout the earlier chapters and will make the idea explicit in the next
section, “Self-Evaluating Rules.”
Constraints on objects can be direct, inhibiting a behavior (actually allow-
ing or prohibiting the execution of a method) or setting limits on the values of
objects contained in instance variables (the knowledge that objects work with
when doing their jobs). Constraints can be indirect, reflecting relationships
among objects instead of object internals.
Examples of direct constraints include
Self-Evaluating Rules
A dependent is eligible for family coverage if she or he is under 18 years of
age, between the ages of 18 and 24 but a full-time student and receiving a
majority of her or his support from the insured, or if she or he is dependent
due to disability or illness.
Your interest rate is the average prime rate (as published in the Wall Street
Journal) for the 30 days preceding the issue date of your statement plus 4.5
percent.
An Employee may have 0 or 1 Spouse.
Py = (1/360 * FA) + (1/12 * (.075 * CB))
Chapter 9 All the World’s a Stage 283
The preceding are examples of business rules. Businesses are rife with
these kinds of statements, formulas, conditionals, and mandated relationships.
Despite the ubiquity and importance of business rules, they are seldom
accorded the status of first-class objects. Instead, rules are documented and pre-
sented as static relationships among classes. (Traditional development methods
deal with rules in the same way—for example, using entity relationships in a
data model.) These static relationships are then supposed to be established and
enforced by appropriate code in object methods or by establishing special-pur-
pose objects, such as a database management object, that specialize in the
maintenance of relationships.
Object thinking mandates that “everything is an object.” A rule6 should
therefore be an object and, like any other object, have the ability to perform a
specific set of services: modify itself and evaluate itself. By modify, we mean
the rule must be flexible: adding, deleting, or extending clauses. By evaluation,
we mean applying computational rules to itself so as to return an object encap-
sulating a meaningful result—in the simplest case, returning a Boolean object
that encapsulates whether the rule was satisfied.
Applying object thinking to the problem of creating a rule object leads to
observations about structure and responsibilities.
6. Many years ago, I formulated the basic ideas of self-evaluating rules and lectured my classes on the
concept. I didn’t actually have a rule object implemented (leaving that as an exercise for the student).
Without implementation, self-evaluating rules were a nice idea, but … Kevin Johnson, one of my grad-
uate students, who later became a colleague and great friend, would occasionally complain that rules
could not be implemented as I was describing them (as described in this chapter). So one day we sat
down and implemented them in Smalltalk, with him doing almost all of the programming. The final
concept of self-evaluating rules is the result of Kevin and me discussing them over many months and
finally implementing them in at least one object language. He and I coauthored an unpublished paper
that is the foundation for most of what is said in this section. I want to thank Kevin and acknowledge
his invaluable assistance in finalizing the ideas in this section.
284 Object Thinking
Behavioral Abstraction
Side 1 (responsibility list) of an object cube for a self-evaluating rule would
have the following entries: modify self and evaluate self. The second responsi-
bility requires collaboration with the ruleElement objects, namely the constants,
variables, and operators.
Side 2 (description and stereotype) might show a stereotype of ordered
collection, reflecting the modify self responsibility coupled with the definition
of a rule: an ordered collection of variables, constants, and operators.
Side 4 (knowledge required) would indicate a need to know about the
ruleElement objects that need to be added, deleted, and so forth but, surpris-
ingly, little else.
Side 5 (message protocol) would define messages for the following: add
an element at a location, delete a designated element, evaluate, instantiate, and
resolve.
Side 3 (contracts) would show that evaluate, add, and delete messages
would be public, while instantiate and resolve would be private.
All basic behavior is now defined. A rule is asked to evaluate itself. It, in
turn, sends itself the instantiate message, causing itself to iterate across its ele-
ments and ask each variable object to instantiate itself (turn itself into an actual
value by sending its message to its receiver). Once all variables are instantiated,
the rule then sends itself the message to resolve—apply the operators appropri-
ately and return the result (with assignment taking place as needed).
Rules are recursive. Any element of a rule can be replaced with a rule.
That’s more than enough flexibility and power to get yourself into trouble
unless you use other object thinking principles, such as simplicity and local
action, to eliminate the need for truly complex rules.
Every object can be given the responsibility to validate itself simply by giv-
ing it a collection of rules to use as collaborators in that process. Those rules
can be modified at run time, just like any other object, merely by sending
appropriate modification messages. Variables can be context sensitive in their
instantiation.
This type of self-evaluating rule was presumed in examples in previous
chapters. The form example assumed that every entry field would have a col-
lection of self-evaluating rules that it would use to validate its contents.
Figure 9-20 provides three examples, the first two showing simple entryField
validation rules and the third showing a more complex rule for form validation.
286 Object Thinking
op op op
const var const
CONCATENATEDWITH op
Implementation
Having thought about all aspects of your objects, your stage, and your scripts
(the ones necessary to complete the story you are working on), you are ready
to write code—almost. If you are an XP developer, you are ready to write tests.
No matter what kind of developer you are, you need to think about two more
details: what your unit tests and code might look like and some additional infor-
mation that must be provided to those objects whose primary role is the main-
tenance of bits of knowledge (“data” objects).
Chapter 9 All the World’s a Stage 287
Methods
For every message you listed on side 5 (message protocol) of the object cube,
you have to write a method and a test of that method (or tests). The first tests
are obvious: When the message is sent to the object, is the expected object
returned? Is it an instance of the right class? Is it in the correct state? By state, I
mean does it have a reasonable value; or, if it is a composite object, do all of its
instance variables have reasonable values?
The next set of tests concerns an object’s ability to recover from errors that
it might encounter between the time it’s asked to do something and the time it
returns an object in response to that request. These tests are trickier because
they usually involve a group of objects and a script. A very simple case would
be an error that occurs when an entryField object cannot validate itself with the
entered object. It must then invoke a dialog box object, ask the dialog to dis-
play an appropriate error message and accept an alternative value, and then
reperform the validation tests.
I have talked a lot about scripts and noted the possibility of script objects
actualizing the sequence of communications among a group of objects. In prac-
tice, a lot of the communications talked about in terms of scripts will be imple-
mented in methods. Thinking about scripts helps you design your next set of
tests. Does the precondition (trigger) implied in the script always cause the
appropriate message to be sent to the appropriate object? Does that object
implement the next bit of the script? Does that implementation satisfy the con-
ditions necessary to continue with the larger script?
The filling in of a form is an example of scripts being implemented in
methods rather than in an independent script object.
■ The form will receive the instantiate message. The form’s instantiate
message will be two lines (in some languages) of code: “Self, iterate
across all entry fields and tell them to instantiate themselves”; and
“Self, send yourself your validate message.”
■ Each entry field will receive the instantiate message. That method
will be about three lines: “Self, ask your source of input (an object in
one of your instance variables) to display itself and return a value to
you”; “Self, ask your validation rules to evaluate using the entered
value”; and “Self, let the form (whoever sent you the instantiate mes-
sage) know that you have successfully completed your job.”
288 Object Thinking
■ Each validation rule will receive the evaluate message. The evaluate
method will have two lines: “Self, instantiate” and “Self, resolve.”
■ Next the validation rule receives the instantiate message. Instantiate
consists of one line: “Self, tell all your elements that are variables to
instantiate themselves.”
■ Then the validation rule receives the resolve message. Resolve con-
sists of one line: “Send the message value to each of your terms in a
recursive fashion.”
Note A CRUD matrix gets it name from the actions create, read,
update, and destroy. It is a simple two-dimensional table that associ-
ates users and data items. Each data item in an application appears at
the head of a row of the matrix, and each user (user role) appears as a
column header in the matrix. Each intersecting cell then contains one
or more of the characters C, R, U, or D, reflecting that users have priv-
ileges (accesses) to the data item.
Chapter 9 All the World’s a Stage 289
It will be essential to obtain this information about all your data objects.
But what do you do with it when obtained? Where is it implemented?
Earlier I suggested that certain classes called primitives are most likely to
be used to maintain knowledge—for example, characters, numbers, strings,
dates, times, and money. The obvious place to store CRUD and data dictionary
information is in the objects that use that information. However, it is unlikely
that you will actually want to modify all of the classes that can be used as prim-
itives. Instead, you might want to create a DataItem class.
A DataItem class is a way to reify passive data into a first-class object. An
instance of DataItem would have the following structure (Figure 9-21 shows the
object cube representation of this structure):
Label A string that names the data item.
Class The name of the class of which this data item is an instance.
Value The actual value of the data item. This would be an instance of one of
the primitive classes.
Composition An optional collection of DataItem objects that actualizes the
data dictionary definition.
Validation rules A collection of self-evaluating rules that would enforce
domain constraints.
Access rule A rule that enforces the line of the CRUD matrix pertinent to this
particular data item.
290 Object Thinking
If you elect the DataItem class option, you will then return to your object
cube, side 4, and replace a lot of the primitives listed there as DataItem objects.
Take care to replace only those primitives that are used more or less exclusively
as knowledge holders. If you are using a string or number, for instance, for
behavioral capabilities and not just to hold a value, you will not want to replace
them with DataItem objects.
Chapter 9 All the World’s a Stage 291
293
294 Object Thinking
agile development, the shared focus on the problem space and the needs of the
customer results in software that is usable and demonstrably supportive of busi-
ness/user requirements.
Unfortunately, there are circumstances in which it is difficult if not impos-
sible to apply object thinking.
Vexations
Sometimes you just can’t do the right thing. Or, more accurately, other consid-
erations make doing the right thing very hard. However diligent an object
thinker you become, you will encounter situations that tax your skills. The most
commonly encountered examples: the necessity of object applications using
relational databases for persistence and object-human communications via
graphical user interfaces.
■ Objects are not defined based on their attributes, but entities and the
tables that they inhabit in a database are defined in precisely that
manner. Objects can store, in a variable, objects whose primary pur-
pose is to provide a calculation or a service rather than to embody a
piece of data. The rules that you follow to make something “persist-
able” vary radically between the object world and the database
world.
■ Objects have variables that can contain arbitrarily complex objects,
including collections and multivalued constructs. Databases can
store only a defined, and limited, set of primitive types. For an object
to be stored in a database, it must be disassembled and translated,
making both storage and retrieval complicated and error-prone pro-
cesses. Several companies have made significant amounts of money
providing special-purpose “object-relational mapping” software that
“solves” this disassembly-and-translation problem.
■ If a running application uses objects that persist in a database, there
is no assurance that an object’s value in the application is consistent
with its value in the database. Other applications might be updating
the database, and there is no way for the database to notify the
object that its persistent value has changed through intervention by
another program. (Extended relational databases now have the abil-
ity to notify objects of this kind of event.)
■ Databases do not preserve the encapsulation of an object. While an
object is persistent (in the database), all of its contents, the objects
stored in the object’s variables and in some cases even the object’s
methods, are available for direct access by any other program using
that database. This leads to all kinds of potential coupling between
objects (based on program-specific contexts), which interferes with
(destroys) the modularization arising from good object design in the
first place.
1. URL—Uniform Resource Locator—is a technical term for the address of resources on the Web. I am
using it more colloquially, still meaning a unique address with the implication that such an address
would be as simple as a URL and be independent of physical implementation (i.e., not rely on
platform-specific offsets and extents).
296 Object Thinking
bit stream) and de-serialize itself in order to reside on the storage medium.2 The
object would also register its location with a “white pages” object so others
could find it when necessary. (The white pages would function much as the
domain name servers employed to match text and numeric URLs for the Web—
that is, they would be hierarchical and replicated for efficiency of access.)
Why Databases?
Persistence is not the only reason for using a database. Databases also
offer computational advantages for certain application needs. For exam-
ple, they provide functions for efficiently and quickly tabulating and com-
puting across large collections of instances (tuples, or rows, in database
vernacular). If I had a large collection of customer objects (a few million,
say) and wanted to know which of them lived in a particular postal code,
I would have to ask each object in turn where it lived and have it report
to an output collection if it lived in the specified postal code. This would
take a long time. If that same collection were stored as tuples in a rela-
tional database, a simple vector operation would extract the relevant
objects in short order. On the other hand, storing a complex object—say
the bill of materials for a passenger jet, perhaps—in a set of relations in a
database and then asking that database to print a list of all components
used to build that airplane would take a long time for the database but
would be a relatively trivial operation for the object. In the main text of
this section, concern is focused on persistence. But object thinking design-
ers need to give attention to the functional advantages of databases as well
as their persistence services.
2. The object-relational mapping software mentioned in this section provides a kind of marshalling
where the serialization results in SQL or proprietary data manipulation statements rather than a bit
stream suitable for writing to magnetic media.
Chapter 10 Wrapping Up 297
most operating systems that allow some users access to files while denying it to
others. The entries in such tables are merely transferred to the objects instead of
being maintained in a central place.)
Until the object vision is realized in full, it will be necessary to compro-
mise and accommodate and make use of existing database systems. Treating
the database as a great big object—employing the concept of putting an object
wrapper around a nonobject thing—is one way to effect that compromise.
3. The term interface is used, unfortunately, in more than one way. It refers to the object-specific mes-
sage protocol plus event notification information as recorded on sides 5 and 6 of an object cube. It
also means the form assumed by an object in order to present itself to a human user or another appli-
cation object. We are using the second sense of the word in this section.
4. In most applications, several objects will be simultaneously presenting themselves to or requesting
interaction with the human user. The totality of the GUI will therefore be composed of multiple object
views. This was noted in the discussion of the MVC architecture in Chapter 9.
298 Object Thinking
5. In an experimental microbrewery, the panel (in conjunction with the brewmeister) might be more
than a passive observer. It might also be a source of instruction to the beer to modify its behavior. It
is still not a controller—merely another interested player that provides services to the beer in its effort
to “be the best brew it can be.”
Chapter 10 Wrapping Up 299
Extensions
One of the tenets of extreme programming involves the avoidance of prema-
ture abstraction. Abstraction, as they are using the term, is a kind of optimiza-
tion that arises from refactoring code. It’s not necessary, however, for every
abstraction to be rediscovered every time it’s used. Abstractions, once discov-
ered, can be remembered and applied in similar circumstances in the future.
This has the effect of accelerating thought and thereby accelerating develop-
ment—something quite consistent with XP principles and values.
For example, the stereotypes discussed as part of side 2 (the description)
of an object cube are abstractions. If you are developing a financial system and
encounter an object named portfolio, your knowledge of collections—an
abstraction—should lead you to discover that a portfolio is just a collection with
some added behavior. Patterns and architectures are another form of abstrac-
tion that you can learn, as abstractions, and then apply as you think about
design and implementation.6 In Chapter 9, some architectural abstractions were
introduced (for example, MVC, blackboards, pipes, and filters). Patterns have
also been introduced—for example, the discussion of blind dispatching, which
is an example of the observer or publish-and-subscribe pattern—but a full
exploration of patterns is best pursued in the patterns literature itself. (See the
bibliography for starting points.)
Frameworks
A framework is another kind of abstraction, somewhere between a design pat-
tern and a full architectural pattern. Frameworks are organizational abstractions
that provide a set of objects with expected behaviors and the relationships that
enable them to interact in order to achieve some collective goal. Good frame-
works provide the essential core of a programming solution. Extension of the
framework by adding other objects and other relationships is expected. How-
ever, a good heuristic is to demand unassailable justification before accepting
any addition to the framework. See if the unaltered framework can solve your
problem before you embellish it. Following are some examples of frameworks.
6. See the work of Alan Shaloway and of Josh Kerievski on refactoring to patterns and Bob Martin’s Agile
Software Development for discussion of how and why patterns serve as guides and targets, not as tem-
plates that get dropped into your design. Blind composition of patterns actually leads to very poor
code.
300 Object Thinking
Composable Document
A composable document has variable content and constraints on the appear-
ance of the content, which are sometimes determined by the presence or
absence of other content. A report is a kind of composable document. A legal
form, like a loan disclosure document, is another.
The composable document framework (Figure 10-1) suggests that a com-
posableDocument is a collection of elements (which means it has the behavior
of adding, deleting, and providing access to the collected elements) that can
identify itself, describe itself, and display itself. Display requires collaboration
with elements, which can display themselves. Both the document and its ele-
ments have extent (the amount of space occupied by the element—for a docu-
ment, usually the two-dimensional area), which can be reported and, in the
case of the document, allocated to an element.
take-the-
form-of-a Variable
Has
Has
Rule Has Constant
Has
Operator
Both elements and the document must satisfy certain composition rules,
which are embodied in self-evaluating rules. (The composition of a rule as a
collection of variables, constants, and operators is shown in Figure 10-1.) This
framework provides all of the objects necessary to model the construction of
any form or report. (Actual display requires a host of additional objects, glyphs,
bitmaps, vector graphics, and so on—a vexation in that way too much work is
required to paint a screen than would be the case if object thinking had guided
the developers of operating systems and graphics libraries.)
Chapter 10 Wrapping Up 301
Network
Address
a-collection-of Link
has
Origin has
Node has Characteristics
Destination
is-ordered- is-an-ordered-collection-of
by
must match/
Route be compatible with
uses/requires
has
has Object has Description
Reservation
Has
Request Resource
Has Has
■ A center circle with icons recalling to mind the driving forces behind
the system under development. In the painting, these are icons
reminding us of attachment, greed, anger, and so on. In a system
model, these would remind us of the importance of money (almost
inevitable), a particular client (a CEO perhaps) who will pass final
judgment on our work, a customer, or a service.
■ A large segmented circle, each segment representing some kind of
portioning of the system, preferably isomorphic to some degree with
the actual portioning of the business for which the system is being
built. In the painting, these are the various realms of existence—for
example, heaven, hell, material world. In our model, these might
represent realms such as order entry, inventory, accounting, and
manufacturing; or segments of a smaller-scale system—data entry,
back-end processing, backup and recovery, and so forth.
■ Icons of various sorts arranged in a tableau evocative of the stories
that relate those icons to one another. Each icon evokes a specific
story or set of stories about a particular element of the overall sys-
tem. Icons can appear in more than one segment.
■ A narrower outer circle, also segmented, with each segment repre-
senting a stage in the “circle of life.” This circle, in the painting, is the
progress from birth to death that each of us traverses. In a system
architecture, each segment would represent a stage in the processing
of whatever the system is intended to support or perhaps some kind
of business cycle from prospect to customer or raw material to prod-
uct.
■ Finally, outside the circle, icons that recall stories about outside influ-
ences, things or forces or people that can affect our system but are
outside the scope of what we can actually build.
Dynamism can be added to the model in many different ways. If each icon
evokes a particular story and the work required to realize that story, the orienta-
tion of the icon (down = not started, right angle left = in progress, vertical = done,
Chapter 10 Wrapping Up 305
right angle right = abandoned dead end) can be used to depict status. A quick
glance at the model reveals a rough approximation of total effort and total
achievements. This is the same information that appears on many an XP
project’s walls and whiteboards but in a more compact form.
The dramatic form and the unusual context behind the presentation of this
architecture might obscure the fact that it’s merely a pictorial representation of
the way that object thinkers think of objects and applications: as stories, à la XP.
composition, proportion (e.g., the Golden Mean), aesthetics, efficiency (not the
rabid concern with machine efficiency of C and C++ programmers—rather, the
efficiency of interaction among humans and objects, and between objects and
objects), and simplicity or elegance. Not being amenable to quantification and
hence formalist corruption, these skills flourished as they had in other artistic
endeavors for centuries.
The basic tools of collagism were all open source, free to anyone to use
and modify. Collagists made money doing what “anyone could do for free” sim-
ply because they had “artistic skill and style.” People were more than willing to
pay for style, just as they did with regard to the other arts. It was a matter of
prestige to have an original “Jeffries payroll system,” and companies were will-
ing to pay for that prestige, just as they did for the Mattisse hanging in the
lobby.
Two markets have come to thrive, side by side: Generic “house-brand”
assemblies and designer assemblies. Users bought what they could afford and
what they most needed. In many cases, generic was more than adequate, but
for some highly visible (or core competency) applications, designer quality was
required—and paid for.
Aspiring collagists shunned software education offered by traditional
departments and universities (even when they stopped calling themselves soft-
ware engineering programs) in favor of apprenticeship programs located in lib-
eral arts colleges.
Objectionary objects turned out to be self-modifiable. A key idea—self-
evaluating rules—was the only prerequisite. Rules can be recursively defined
and can be modified simply by adding, deleting, or reordering the member
objects. Self-evaluating rules are well suited for use as genetic algorithms.
Shortly after the release of the Objectionary, various assembly hackers noticed
this fact and took advantage of it to create objects that reconfigured themselves
as a function of the environment in which they operated.
The earliest self-modifying software consisted of nothing more than com-
plex rules that evaluated to some result that could be subjected to a fitness test.
Later attempts allowed participation of all sorts of objects, applications (as it
were) that were free to modify the collection of participating objects, the script
object that coordinated the interaction of the objects in that collection, and the
rules contained within each object that constrained or enhanced its individual
behavior.
An interesting story, or a plan of action for Object Thinkers and Xgilistas?
Bibliography
(Books marked with an * are particularly relevant to the philosophical underpinnings of
object thinking as discussed in the first chapters of this book.)
Albin, Stephen T. The Art of Software Architecture: Design Methods and Techniques.
Indianapolis, IN: Wiley Publishing, Inc., 2003.
*Alexander, Christopher. Notes on the Synthesis of Form. Cambridge, MA: Harvard University
Press, 1964.
Alexander, Christopher, Sara Ishikawa, and Murray Silverstein. A Pattern Language: Towns,
Buildings, Construction. New York: Oxford University Press, 1977.
*Alexander, Christopher. The Timeless Way of Building. New York: Oxford University Press,
1979.
*Alexander, Christopher. The Nature of Order: Book One, The Phenomenon of Life. New
York: Oxford University Press, 2001.
Ambler, Scott W. The Object Primer: The Application Developer’s Guide to Object-Orientation.
New York: SIGS Books, 1995.
Anderson, Jim, George Bosworth, Alberto A. Della Ripa, Barbara Noparstak, and Michael
Teng. Methods Owners Manual. Digitalk,1985.
Arranga, Edmund C., and Frank P. Coyle. Object Oriented COBOL. New York: SIGS Books,
1996.
Arthur, Lowell Jay. Rapid Evolutionary Development: Requirements, Prototyping & Software
Creation. New York: John Wiley & Sons, 1992.
Bahar, Mory. Object Technology Made Simple. East Greenwich, RI: Simple Software
Publishing, 1996.
Bapat, Subodh. Object-Oriented Networks: Models for Architecture, Operations, and
Management. Englewood Cliffs, NJ: PTR Prentice Hall, 1994.
Bassett, Paul G. Framing Software Reuse: Lessons from the Real World. Upper Saddle River,
NJ: Prentice Hall PTR, 1997.
Baudoin, Claude, and Glenn Hollowell. Realizing the Object-Oriented Lifecycle. Upper Saddle
River, NJ: Prentice Hall PTR, 1996.
309
310 Object Thinking
*David, Alan M. 201 Principles of Software Development. New York: McGraw-Hill, Inc.,
1995.
*Dahlbom, B., and L. Mathiassen, Computers in Context: The Philosophy and Practice of
Systems Design. Oxford: Blackwell, 1993.
De Champeaux, Dennis, Douglas Lea, and Penelope Faure. Object-Oriented System
Development. Reading, MA: Addison-Wesley Publishing Company, 1993.
Deitel, H. M., P. J. Deitel, J. A. Listfield, T. R. Nieto, C. H. Yaeger, and M. Zlatinka. C#: A
Programmer’s Introduction. Upper Saddle River, NJ: Prentice-Hall, 2003.
Digitalk, Inc. Smalltalk/V. Los Angeles, CA: Digitalk, Inc., 1986.
*Dittrich, Yvonne, Christiane Floyd, and Ralf Klischewski. Social Thinking—Software
Practice. Cambridge, MA: MIT Press, 2002.
Dorfman, Len. Object-Oriented Assembly Language. Blue Ridge Summit, PA: Windcrest,
1990.
*Dreyfus, Hubert L. Husserl, Intentionality, and Cognitive Science. Cambridge, MA: MIT
Press, 1982.
*Dreyfus, Hubert L., and Stuart E. Dreyfus with Tom Athanasiou. Mind over Machine. New
York: The Free Press, a division of Macmillan, Inc., 1985.
Eeles, Peter, and Oliver Sims. Building Business Objects. New York: John Wiley and Sons,
Inc., 1998.
*Ehn, Pelle. Work-Oriented Design of Computer Artifacts. Stockholm: Arbetslivcentrum,
1988.
Ellis, John R. Objectifying Real-Time Systems. New York: SIGS Books, 1994.
Embley, David W., Barry D. Kurtz, and Scott N. Woodfield. Object-Oriented Systems
Analysis: A Model Driven Approach. Englewood Cliffs, NJ: Prentice Hall PTR,
1992.
Evans, Eric. Domain-Driven Design: Tackling Complexity in the Heart of Software. Boston:
Addison-Wesley, 2004.
*Feyerabend, Paul. Against Method. London: Verso, 1975.
Fingar, Peter. The Blueprint for Business Objects. New York: SIGS Books, 1996.
Firesmith, Donald G. Object-Oriented Requirements Analysis and Logical Design: A
Software Engineering Approach. New York: John Wiley and Sons, Inc., 1993.
*Floyd, C., H. Zullighoven, R. Budde, and R. Keil-Slawik. Software Development and Reality
Construction. Berlin: Springer-Verlag, 1991.
Bibliography 313
Fowler, Martin. Analysis Patterns: Reusable Object Models. Menlo Park, CA: Addison-Wesley
Longman, Inc., 1997.
Fowler, Martin. Refactoring: Improving the Design of Existing Code. Reading, MA: Addison-
Wesley, 1999.
Frolund, Svend. Coordinating Distributed Objects: An Actor-based Approach to Synchroni-
zation. Cambridge, MA: MIT Press, 1996.
*Gabriel, Richard P. Patterns of Software: Tales from the Software Community. Oxford:
Oxford University Press, 1996.
*Gadamer, Hans-George. Philosophical Hermeneutics. Translated and edited by David E.
Linge. Berkeley: University of California Press, 1976.
*Gadamer, Hans-George. Reason in the Age of Science. Translated by Frederick G.
Lawrence. Cambridge, MA: MIT Press, 1982.
Gale, Thornton, and James Eldred. Getting Results with the Object-Oriented Enterprise
Model. New York: SIGS Books, 1996.
Gamma, Erich, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns: Elements
of Reusable Object-Oriented Software. Reading, MA: Addison-Wesley, 1995.
*Glass, Robert L. Software Creativity. Englewood Cliffs, NJ: Prentice-Hall PTR, 1995.
*Glass, Robert L. Facts and Fallacies of Software Engineering. Boston: Addison-Wesley,
2003.
Goldberg, Adele, and Ken Rubin. Succeeding with Objects: Decision Frameworks for Project
Management. Reading, MA: Addison-Wesley Publishing Co., 1995.
Gossain, Sanjiv. Object Modeling and Design Strategies. SIGS Books. Cambridge: Cambridge
University Press, 1998.
Graham, Ian. Migrating to Object Technology. Wokingham, England: Addison-Wesley
Publishing Co., 1994.
Grand, Mark. Patterns in Java, vol 1. New York: John Wiley and Sons, Inc., 1998.
Greenbaum, Joan, and Morten Kyng. Design at Work: Cooperative Design of Computer
Systems. Hillsdale, NJ: Lawrence Erlbaum Associates, Publishers, 1991.
Henderson-Sellers, Brian, and Julian Edwards. The Working Object. Sydney, Australia: Prentice-
Hall, 1994.
Henderson-Sellers, Brian. Object-Oriented Metrics: Measures of Complexity. Upper Saddle
River, NJ: Prentice Hall PTR, 1996.
Highsmith III, James A. Adaptive Software Development: A Collaborative Approach to
Managing Complex Systems. New York: Dorsett House Publishing, 2000.
314 Object Thinking
LaLonde, Wilf. Discovering Smalltalk. Redwood City, CA: Benjamin Cummings Publishing
Co., Inc., 1994.
Larman, Craig. Agile and Iterative Development: A Manager’s Guide. Boston: Addison-
Wesley, 2004.
Lau, Chamond. Smalltalk, Objects, and Design. Greenwich, CT: Manning Publications Co.,
1996.
Lewis, Simon. The Art and Science of Smalltalk. London: Prentice Hall PTR, 1995.
Loomis, Mary E. S. Object Databases: The Essentials. Reading, MA: Addison-Wesley
Publishing Co., 1995.
Lorenz, Mark. Object-Oriented Software Development: A Practical Guide. Englewood Cliffs,
NJ: Prentice-Hall, 1993.
Lorenz, Mark. Rapid Software Development with Smalltalk. New York: SIGS Books, 1995.
Love, Tom. Object Lessons: Lessons Learned in Object-Oriented Development Projects. New
York: SIGS Books, 1993.
*McBreen, Pete. Software Craftsmanship: The New Imperative. Boston: Addison-Wesley,
2002.
McGibbon, Barry. Managing Your Move to Object Technology: Guidelines and Strategies for
a Smooth Transition. New York: SIGS Books, 1995.
McNally, Clayton L., Jr., and Peter Molchan Jr. Micro Focus COBOL Workbench. Boston:
QED Publishing Group, 1993.
Martin, James. Information Engineering: Book 1—Introduction. Englewood Cliffs, NJ:
Prentice-Hall, 1989.
Martin, James, and James J. Odell. Object-Oriented Analysis and Design. Englewood Cliffs,
NJ: Prentice Hall, 1992.
Martin, Robert, Dirk Riehle, and Frank Buschmann, eds. Pattern Languages of Program
Design 3. Cambridge, MA: Addison-Wesley Publishing Co., 1998.
Martin, Robert C., with contributions by James W. Newkirk and Robert S. Koss. Agile Soft-
ware Development: Principles, Patterns, and Practices. Upper Saddle River, NJ:
Pearson Prentice Hall, 2003.
Masini, Gerald, Amedeo Napoli, Dominique Colnet, Daniel Leonard, and Karl Tombre.
Object Oriented Languages. Academic Press. London: Harcourt Brace Jovanovich,
Publishers, 1991.
*Maturana, Humberto R., and Francisco Varela. Autopoiesis and Cognition: The Realization
of the Living. Dordrecht: Reidel, 1980.
316 Object Thinking
*Maturana, Humberto R., and Francisco Varela. The Tree of Knowledge: The Biological Roots
of Human Understanding. Boston: New Science Library, Shambala, 1987.
Meyer, Bertrand. Object Oriented Software Construction. New York: Prentice Hall, Inc.,
1988.
Meyer, Bertrand. Object Success: A Manager’s Guide to Object-Orientation, Its Impact on the
Corporation and Its Use for Reengineering the Software Process. London: Prentice
Hall, 1995.
Miller, Byron. Object Oriented Design Made Easy. Minneapolis, MN: Impatiens Publications,
1993.
*Minsky, Marvin. Society of Mind. New York: Simon and Schuster, 1987.
Montgomery, Stephen L. Object-Oriented Information Engineering: Analysis, Design, and
Implementation. Boston: Academic Press Professional, 1994.
Morris, Derrick, Gareth Evans, Peter Green, and Colin Theaker. Object-Oriented Computer
Systems Engineering. London: Springer-Verlag, 1996.
Mowbray, Thomas J., and Raphael C. Malveau. CORBA Design Patterns. New York: John
Wiley & Sons, Inc., 1997.
Muller, Robert J. Productive Objects: An Applied Project Management Framework. San
Francisco: Morgan Kaufmann Publishers, Inc., 1998.
*Nardi, Bonnie A., and Vicki L. O’Day. Information Ecologies: Using Technology with Heart.
Cambridge, MA: MIT Press, 1999.
Newkirk, James, and Robert C. Martin. Extreme Programming in Practice. Boston: Addison-
Wesley, 2001.
Oliver, David W., Timothy P. Kelliher, and James G. Keegan Jr. Engineering Complex
Systems with Models and Objects. New York: McGraw-Hill, 1997.
Orfali, Robert, Dan Harkey, and Jeri Edwards. The Essential Distributed Objects Survival
Guide. New York: John Wiley and Sons, Inc., 1996.
Page-Jones, Meilir. The Practical Guide to Structured Systems Design, second edition,
Englewood Cliffs, NJ: Prentice-Hall, Inc., 1988.
Palsberg, Jens, and Michael I. Schwartzback. Object-Oriented Type Systems. Chichester,
England: John Wiley and Sons, 1994.
Papurt, David M. Inside the Object Model: The Sensible Use of C++. New York: SIGS Books,
1995.
Bibliography 317
Parsaye, Kamran, Mark Chignell, Setraqg Khoshafian, and Harry Wong. Intelligent
Databases: Object-Oriented Deductive Hypermedia Technologies. New York:
John Wiley and Sons, Inc., 1989.
Partridge, Chris. Business Objects: Re-engineering for Re-use. Oxford: Butterworth-Heine-
mann, 1996.
Pawson, Richard, and Robert Matthews. Naked Objects. Hoboken, NJ: John Wiley & Sons
Ltd., 2002.
Poppendieck, Mary and Tom. Lean Software Development: An Agile Toolkit. Boston:
Addison-Wesley, 2003.
Pree, Wolfgang. Design Patterns for Object-Oriented Software Development. Wokingham,
England: Addison-Wesley Publishing Company, 1995.
Rasmus, Daniel W. Rethinking Smart Objects: Building Artificial Intelligence with Objects.
SIGS Books. Cambridge: Cambridge University Press, 1999.
Riel, Arthur J. Object-Oriented Design Heuristics. Reading, MA: Addison-Wesley Publishing
Co., Inc., 1996.
Rumbaugh, James, Michael Blaha, William Premerlaini, Frederick Eddy, and William
Lorensen. Object-Oriented Modeling and Design. Englewood Cliffs, NJ: Prentice
Hall PTR, 1991.
Rumbaugh, Dr. James. OMT Insights. New York: SIGS Books, 1996.
Schach, Stephen R. Classical and Object Oriented Software Engineering. Chicago: Irwin,
1996.
Schwaber, Ken, and Mike Beedle. Agile Software Development with Scrum. Upper Saddle
River, NJ: Prentice-Hall, 2002.
Shlaer, Sally, and Stephen J. Mellor. Object-Oriented Systems Analysis: Modeling the World
in Data. Yourdon Press. Englewood Cliffs, NJ: Prentice Hall, 1988.
Shlaer, Sally, and Stephen J. Mellor. Object Lifecycles: Modeling the World in States. Engle-
wood Cliffs, NJ: Prentice Hall, Inc., 1992.
Selic, Brian, Garth Gullekson, and Paul T. Ward. Real-Time Object-Oriented Modeling. New
York: John Wiley and Sons, 1994.
Sessions, Roger. Object Persistence: Beyond Object-Oriented Databases. Upper Saddle
River, NJ: Prentice Hall PTR, 1996.
Stapleton, Jennifer. DSDM: Dynamic Systems Development Method. Harlow, England:
Addison-Wesley, 1997.
318 Object Thinking
*Suchman, L. Plans and Situated Actions. Cambridge, England: Cambridge University Press,
1987.
Succi, Giancarlo, and Michele Marchesi. Extreme Programming Examined. Boston:
Addison-Wesley, 2001.
Sullo, Gary C. Object Engineering: Designing Large-Scale Object-Oriented Systems. New
York: John Wiley and Sons, Inc., 1994.
Sully, Phil. Modeling the World with Objects. New York: Prentice Hall, 1993.
Szyperski, Clemens. Component Software: Beyond Object-Oriented Programming. Harlow,
England: Addison-Wesley, 1999.
Taylor, David A. Object-Oriented Technology: A Manager’s Guide. Reading, MA: Addison-
Wesley, 1990.
Taylor, David A., PhD. Object-Oriented Information Systems: Planning and Implementa-
tion. New York: John Wiley and Sons, 1992.
*Taylor, David A., PhD. Business Engineering with Object Technology. New York: John
Wiley and Sons, 1995.
Tkach, Daniel, and Richard Puttick. Object Technology in Application Development. Red-
wood City, CA: The Benjamin Cummings Publishing Co., 1994.
Vlissides, John M., James O. Coplien, and Norman L. Kerth. Pattern Languages of Program
Design 2. Cambridge, MA: Addison-Wesley Publishing Co., 1996.
Wake, William C. Extreme Programming Explored. Boston: Addison-Wesley, 2002.
Walden, Kim, and Jean-Marc Nerson. Seamless Object-Oriented Software Architecture:
Analysis and Design of Reliable Systems. New York: Prentice Hall PTR, 1995.
Webster, Bruce F. Pitfalls of Object-Oriented Development. New York: M&T Books, 1995.
White, Iseult. Using the Booch Method: A Rational Approach. Redwood City, CA: The
Benjamin Cummings Publishing Company, 1994.
Wilkie, George. Object-Oriented Software Engineering: the Professional Developer’s Guide.
Wokingham, England: Addison-Wesley, 1993.
Wilkinson, Nancy M. Using CRC Cards: An Informal Approach to Object-Oriented Develop-
ment. New York: SIGS Books, 1995.
Williams, John. What Every Software Manager Must Know to Succeed with Object Technol-
ogy. New York: SIGS Books, 1995.
*Winograd, Terry. Bringing Design to Software. New York: ACM Press, 1996.
Winston, Patrick Henry. On to Smalltalk. Reading, MA: Addison-Wesley, 1998.
Bibliography 319
321
322 architectures
customers designs
models, 5 decision hiding, 40
on-site, linked to object thinking, 23 as defined by Christopher Alexander, 249
GUI-driven
dangers of, 241
D
data vs. object-oriented programming, 110
vs. behavior, 124 of objects, 219–245
as decomposition tool, 76 decisions regarding object design, 221
nonexistent in object thinking, 121 guiding object design by domains and object
as objects, 67, 259–263. See also knowledge, behaviors, 221
maintenance objects implications of thinking toward object design,
poor choice for decomposition tool, 74–75 220
treating as passive, 9 simple, linked to object thinking 22
uniting with procedures, 9 determinism. See formalism
databases development, software, limited concept of reuse,
in ideal object environment, 295 97
impedance mismatch problem, 294–297 diagrams. See also models
management systems, 148 interaction, 175–178
philosophy vs. object thinking, 294 Behavior! tool, 274
reasons for using, 296–297 use cases, 176
relational usefulness of, 178
implications of employing, 45–47 soccer ball
problems with mixing objects and, 294–295 vs. object thinking, 3
datacentricity, 15 reinforcing program thinking, 4
DataItem class, 289–290 static relation, 178–181
DBMS. See databases, management systems class hierarchy diagrams, 179
decomposition, 164 collective memory maps, 181
applying object thinking to, 219 gestalt maps, 179
vs. assembling applications, 98–100 Dijkstra, Edsger Wybe
criteria for proper, 72–75 accomplishments of, 73–74
described by Plato, 72 example of formalist position, 73–74
guided by object-as-person metaphor, 104 discovery, 183–218, 226
object, 8 applying object thinking to decomposition, 219
object thinking heuristics, 283–284 decomposition, 220
Parnas, David Lorge domains
decomposing according to design decisions, anthropology, 186–200
74 understanding, 185–200
On Decomposition (paper written by), 40 object definition, 200–218
providing insufficient information for object abstractions, 203, 204
simulations, 220 capturing object information, 200–218
tools, 74–75 classification, 203
traditional, 8 essentialism, 203
delegation, 213–214 generalizations, 203
vs. multiple inheritance, 139–140 heuristics, 212–218
result of refactoring, 214 vs. object specification, 200
dispatching events, 277–280
formalism 325
I knowledge
idioms, 224–225 maintenance objects, 288–290
determining factors, 224 CRUD matrices, 288
examples of, 224 primitives, 289–290
proper use of, 224 requirements, 221–229
impedance mismatch problem, 149, 294–297 choosing appropriate piece of knowledge,
cause of, 257 225–226
databases, 294–297 responsibilities, 222–224
implementation ways for an object to gain knowledge, 225
domains, 148
languages, 34–36 L
pitfall of moving directly into, 219 Lakoff, George
informalism, 160, 161, 162 research by, revealing central role of metaphor
inheritance, 114–115, 133–136 in human cognition, 93
genealogical charts, 114 Whorf-Sapir hypothesis, 7
multiple, 136, 139–140 languages. See also programming languages
obtaining reuse through, 150 influence on thinking, 7, 8
taxonomies pattern, 143, 163
behavior as criterion for, 114 late binding. See dynamic (late) binding
Linnaean, 114, 133 Lego brick metaphor, 96–101
instance variables, 145 architects as domain experts, 99
integrated development environments (IDEs), compared to software integrated circuits
240 metaphor, 96
interaction diagrams, 175–178 compared to XP, 101
Behavior! tool, 274 delivering objects to end users, 98
specifying scripts with, 274–277 delivering objects to professional assemblers,
use cases, 176 99
usefulness of, 178 employing bricks based on obvious
interfaces characteristics, 99
protocols, 129 Legoland store, events sponsored by, 99
views, as means for interobject communication, small number of simple objects suggested by,
297 100
interpretationalism. See hermeneutics libraries, class. See classes, libraries
is-a-kind-of relationships, 251–253 Linnaean taxonomy, 76, 133
isomorphism, 18 LISP (nonprocedural language), datacentric
development accommodated in, 15
J–K Lorenz, Mark (metrics for object projects), 10–11
Java, C++ superseded by, 29 Low-Income Mortgage Trust (LIMT), 170–173
Kahn, Philippe, 101–102
Kay, Alan M
describing Smalltalk, 43–45 managers, traditional thinking indicated by, 11
Dynabook idea developed by, 37 maps
objects as virtual computers, 106 collective memory, 181, 259–263
thinking about computers changed by, 37 domain-level vs. enterprise-level, 262
Kidd, Jeff (metrics for object projects), 10–11
328 mechanism
maps, collective memory, continued small number of simple objects suggested by,
modeling relationships among data depiction 100
objects, 259–263 linked to object thinking, 22
rules for construction, 262 role in everyday thinking, 93
gestalt, 179 role in XP and object thinking, 94
mechanism. See formalism software as theater, 108–111
messages, 227–240 re-creating old standards, 108
contracts, 234–235 scripting, complexity of, 109
protocols, 227–232 software integrated circuits, 92
state change notifications, 236–240 thinking shaped by, 93–94
types, 128 methods, 159–164
metaphors, 91–116 aformal
anthropomorphism, 93, 101–108 importance of human developer, 160
applying object-as-person metaphor, 102–103 vs. other methods, 161
delegation, 103 behavioral, 158–159
guiding decomposition, 104 difference from traditional methods, 159
limitations of objects, 103 reasons for failure in market, 158–159
object-as-agent metaphor, 107 cultures embracing, 161–164
objects as actors, 107 aformalism, 161–163
Philippe Kahn using musicians to illustrate, formalism, 161–162
101 informalism, 161–162
replacing metaphors with suppositions, data-driven, 155–157
107–108 efficacy, criteria for, 164
ants as exercises, 163–164
vs. centralized control, 112–113 formal, 160
complex adaptive systems, 113 implementing scripts using, 287–288
traffic signal example, 112 informal, 160
central role of, in human cognition, 93 private, 145
contrasted with specifications, 107 public, 145
human-derived software engineering, 157–158
inheritance, 114–115 syncretism, 164–168
responsibility, 115–116 defined, 165
inheritance, 133–136 requirements imposed by object thinking,
multiple, 136 166–167
taxonomies, 133 vs. traditional functions, 145
Lego bricks, 96–101 Microsoft Visual Basic. See Visual Basic
architects as domain experts, 99 minimal-intervention principle, 250
compared to software integrated circuits, 96 models, 168–182
compared to XP, 101 architectural, 263–273
composability of, 96 blackboard, 266
delivering objects to end users, 98 client/server, 266
delivering objects to professional assemblers, hierarchical control, 263
99 pipes-and-filters, 265
employing bricks based on obvious collective memory maps, 259–263
characteristics, 99 domain-level vs. enterprise-level, 262
Legoland store, events sponsored by, 99 rules for construction, 262
customer (entity, object, UML), 5
object models 329
diagrams O
interaction, 175–178 object analysis, CRC card approach, 27
static relation, 178–181 object applications vs. DBMS execution
entity, 6 environments, 149
in model-view-controller architectures, 268 object behavior analysis (OBA), 154
object object cubes, 173–175, 201–212
vs. entity models, 6 air traffic control example, 209–212
vs. UML models, 6 airplane example, 222–224
object cubes, 173–175 aspects (sides), 173–175
aspects (sides), 173–175 compared with CRC cards, 201
derived from CRC cards, 173 CRC cards as foundation of, 28, 173
of objects self-evaluating rules, 285
animated data entity, 122 object culture, 65–89
soccer ball, 122 characteristics, 65
semantic nets, 169–173 groups included in, 65
as brainstorming tools, 172 value of awareness of object culture, 65
Low-Income Mortgage Trust example, object definition, 200–218
170–173 abstractions, 203, 204
state, 278–280 capturing object information, 200–218
state charts, 181–182 object cubes, 201–212
static relationship, 256–259 stereotypes, 200, 209
UML, 6 classification, 203
model-view-controller (MVC) architectures, essentialism, 203
264–273 generalizations, 203
controllers (coordinators), 270–271 heuristics, 212–218
event dispatchers, 271 anthropomorphism, 215
models, assuming role of application objects, assuming responsibility for tasks, 213
269 avoiding characteristic-specific
outside world, 272–273 responsibilities, 216–217
views, GUI environments and, 269 creating proxies for objects, 218
modularization, destruction of by object delegating responsibilities, 213–214
coupling, 295 determining components, 218
modules, black box, 60 distributing responsibilities, 215
musicians, used by Philippe Kahn to illustrate foreshadowing, 214–215
anthropomorphism, 101 stating responsibilities, 215
vs. object specification, 200
N object discovery, 100
nondeterminism, 53 object methodology, history of, 153–159
nonprocedural languages, 15 behavioral methods, 158–159
normalization rules data-driven methods, 155–157
entity models, 5 Goldberg, Adele, 154
object models, 6 RUP, 155
UML models, 5 software engineering methods, 157–158
Nygaard, Kristen (developer of SIMULA UML, 155
programming language), 37 object models, 5
vs. entity models, 6
vs. UML models, 6
330 object programming (in Smalltalk)
routes, in object routing and tracking framework, domain-level vs. enterprise-level, 262
301 rules for construction, 262
rules static relationship models (SRMs), 256–259
creating as first-class objects, 286 Smalltalk, 20, 43–45, 101, 154, 240
normalization challenged by C++, 29
entity models, 5 class libraries, 98
object models, 6 computer efficiency subordinate to other goals,
UML models, 5 44
recursiveness of, 285 demise of, 29
self-evaluating, 282–286 described by Alan Kay, 43–45
behaviors, 285–286 designed by Alan Kay, 37
business rules, 283 developed in parallel with graphical user
defined, 5 interfaces, 110
structure, 283–284 development of, 28
RUP (Rational Unified Process), 155 emphasis on GUI building, 240
soccer ball model, 3–4, 122
vs. object thinking, 3
S
scenarios. See interaction diagrams reinforcing program thinking, 4
scripts, implementing with methods, 287–288 software development
self-evaluating rules, 282–286 addressing difficulties, 85–87
behaviors, 285–286 as art, 24
business rules, 283 manufacturing software developers, 24
defined, 5 mastering software development, 24
object cubes, 285 bias toward rationalism, 25
operators, 284 as cultural activity, 25–30
structure, 283–284 failure to remove humanity from, 24
variables, 284 limited concept of reuse, 97
semantic nets, 169–173 as social activity, 26
as brainstorming tools, 172 trends in, 26
compared with static relationship models using rules, 86–87
(SRMs), 257 software integrated circuits, 92
constructing, 189–192 software patterns, 18
Low-Income Mortgage Trust example, 170–173 software quality, principles of, 83–87
semantics, relationship to hermeneutics, 52 software-as-theater metaphor, 108–111
simplicity, as value in agile development, 20 re-creating old standards, 108
SIMULA, 38–41, 164 scripting, complexity of, 109
focus on problem description, 40 solution space vs. problem domain, 16, 97
objectives, 39 Soviet Union, 112
situational relationships, 251, 256–273 Squeak (reinvention of Smalltalk), 37
architectures, 263–273 standards, coding, 23
blackboard, 266 states
client/server, 266 capturing information about UML, 245
hierarchical control, 263 change notifications, 236–240
model-view-controller, 264–273 charts, 181–182
pipes-and-filters, 265 constraints based on, 245
collective memory maps, 259–263 modeling, 278–280
Visual Studio, as example of visual programming environment 333
V
T validation, 205–209
taxonomies, 251–253 variables
behavior as criterion for, 114 class, 145
derived from classes and is-a-kind-of instance, 145
relationships, 251 self-evaluating rules, 284
Linnaean, 76, 114, 133 views
of objects, 79 as means for interobject communication, 297
rules for, 253 in model-view-controller architectures, 269
Taylor, David A. of objects, 240–245
convergent engineering, 70 RDBMSs, 242
framework for business objects, 70 virtual computers, 15
testing virtual persons, 16
development driven by, 124 Visual Basic
of methods, 287, 288 class libraries, 98
thinking, as influenced by language, 7, 8 superseding C++, 29
Timeless Way of Building, The, 144, 163 Visual C++, as example of compile-link-test
tools environment, 101
automated (CASE tools), 152 visual programming environments, 101
object-modeling, 15 Visual Studio, as example of visual programming
traditional software development, 108. See also environment, 101
formalism
334 vocabularies, specialized
Proof of Purchase
Use this page as proof of purchase if participating in a promotion or rebate offer on
this title. Proof of purchase must be used in conjunction with other proof(s) of
payment such as your dated sales receipt—see offer details.
Object Thinking
0-7356-1965-4
CUSTOMER NAME
Microsoft Press, PO Box 97017, Redmond, WA 98073-9830