Requirements analysis and domain analysis precede design
So far we’ve looked at requirements analysis—understanding what the customer wants
analysis understands the customer’s problem—by identifying the classes comprising
a problem domain.
Design explores their contents, from outside in
What’s the difference between traditional or structured analysis and OO analysis?
Result of OO analysis is a representation of the
of a problem domain (not functions)
Identifying classes is
some slice of the world which a computer system models
Objects are a natural construct for simulation
Classes of objects are a natural way to organize classes
Infants learn to recognize
and how to categorize
them in their first few months
A key insight of the child psychologist Piaget; cognitive scientists have done further
Adults rely on categorization to understand the world around them
We create new categories all the time, for example, new makes of cars
A problem with categories, however, is that they can be fuzzy and hard to define precisely
: how do you define an elephant? a game?
: people see how close objects match a prototypical member of a category
Why is the fuzziness of natural kinds a problem for OOSE?
It's hard to be precise about defining categories
That's why we need a methodology for OOSE
Some categories are directly observable in requirements
Others are more abstract, implicit or arising from implementation needs
Candidate classes include:
Tangible things referred to by common
in requirements specification
or application domain (i.e., cookie, factory, triangle)
with associated information (i.e.,
buffer, tree, hash table
External interface ports (i.e.,
terminal, printer, window, menu
Complex processes or operations (i.e.,
sort, edit command
can also be classes!
Especially processes than store state information.
One might think of a scanner as an operation on tokens of class STRING
But a scanner's behavior probably deserves its own abstraction
As a subclass of STRING?
Can anything be a class?
Indeed, category-formation is a fundamental human activity
But there are practical limits: classes should have content, storing state information
Simple operations (e.g., QUIT)
Proper nouns (these are instances of classes, not classes)