We still have a question mark, though. That question mark relates to the comment
we just made about discovering the objects that we forgot when we took our first
guess. This implies that we’re going to take a first guess at some point.
There’s a magic phrase that we use to help teach people how to write use cases
successfully: Describe system usage in the context of the object model. The first
thing this means is that we’re not talking, in this book, about writing fuzzy, abstract
and vague, ambiguous use cases that don’t have enough detail in them from which
to produce a software design. We’re going to teach you to write use cases that are
very explicit, precise, and unambiguous. We have a very specific goal in mind when
discussing use cases: we want to drive the software design from them. Many books
on use cases take a different perspective, using use cases as more of an abstract
requirements exploration technique. Our approach is different because our goals are
different. Remember, our mission is to help you get from use cases to code.
We’ll start out with something called a domain model, which is a kind of glossary of
the main abstractions—in other words, the most important nouns that are in our
problem space (our problem domain). In the term domain model, the word
“domain” comes from the idea of the problem domain. For example, if our problem
domain is electronic commerce—as it is in the workbook, amazingly enough—we’ll
probably have a domain object like a catalog or a purchase order. We’re going to call
these nouns that belong to our problem space domain objects, and we’re going to
produce, at the very beginning of our analysis and design activities, something called
a domain model, which lays all these domain objects out on one big UML class
diagram.
On our robustness diagrams, we’re also going to use something called boundary
objects. Among the boundary objects, we find things like the screens of the system.
In the text of our use cases, we want to explicitly reference both domain objects and
boundary objects. We’ll write about such things as how the users interact with the
screens and how those screens interact with the domain objects, which often have
some mapping onto a database that may sit behind the OO part of our system. Our
use case text will get a lot more specific and a lot less ambiguous if we follow this
guideline of describing how the system is used in the context of the object model as
it evolves.
During domain modeling, we want to identify the most important set of abstractions
that describe the problem space, or the problem domain of the system, that we need
to build. For this task, we’ll follow the methodology Jim Rumbaugh developed: the
Object Modeling Technique (OMT), which is a very thorough treatment of some
useful techniques for helping us do this domain model.
One difference between our approach and some of the other use case–oriented
approaches you might run across is that we insist on starting the whole process with
domain modeling. In writing our use cases against the set of nouns in the domain
model, thus using that domain model as a glossary, we can unambiguously define a
set of terms that we can reference within our use case text. This approach proves to
be quite useful, especially when you’re working in a team environment where there
are multiple groups of people that are trying to describe scenarios in different parts
of the system. If you get closure and agreement on what the important nouns in the
system are, you eliminate whole layers of ambiguity in the use case models. For
example, this enables you to be clear on what a purchase order is, what a line item
is, and what a shopping cart is. All those things are clear from the beginning, due to
the fact that we’ve defined a glossary of terms before we start writing our use cases.