Sams Teach Yourself C++ in 21 Days

(singke) #1
reflect the real world so that the model can be used to predict the behavior of things in
the real world.
A child’s globe is a classic model. The model isn’t the thing itself; a child’s globe would
never be confused with the Earth, but one maps the other well enough that you can learn
about the Earth by studying the globe.
There are, of course, significant simplifications. My daughter’s globe never has rain,
floods, globe-quakes, and so forth, but I can use her globe to predict how long it will
take me to fly from my home to Indianapolis should I ever need to come in and explain
myself to the Sams senior management when they ask me why my manuscript was late
(“you see, I was doing great, but then I got lost in a metaphor and it took me hours to
get out”).
A model that is not simpler than the thing being modeled is not much use. The comedian
Steve Wright quips: “I have a map on which one inch equals one inch. I live at E5.”
Object-oriented software design is about building good models. It consists of two signifi-
cant pieces: a modeling language and a process.

Software Design: The Modeling Language ........................................................


Themodeling languageis the least important aspect of object-oriented analysis and
design; unfortunately, it tends to get the most attention. A modeling language is nothing
more than a convention for representing a model in some other medium such as paper or
a computer system, and in some format such as graphics, text, or symbols. For example,
you can easily decide to draw your classes as triangles and draw the inheritance relation-
ship as a dotted line. If so, you might model a geranium as shown in Figure 11.1.

330 Day 11


FIGURE11.1
Generalization/
specialization.

Flower

Geranium
Free download pdf