Object-Oriented Analysis and Design 331
11
In the figure, you see that a Geranium is a special kind of Flower. If you and I agree to
draw our inheritance (generalization/specialization) diagrams like this, we’ll understand
each other perfectly. Over time, we’ll probably want to model lots of complex relation-
ships, and so we’ll develop our own complicated set of diagramming conventions and
rules.
Of course, we’ll need to explain our conventions to everyone else with whom we work,
and each new employee or collaborator will have to learn our conventions. We might
interact with other companies that have their own conventions, and we’ll need to
allow time to negotiate a common convention and to compensate for the inevitable
misunderstandings.
It would be more convenient if everyone in the industry agreed on a common modeling
language. (For that matter, it would be convenient if everyone in the world agreed on a
single spoken language, but one thing at a time.)
The lingua francaof software analysis and design is UML—the Unified Modeling
Language. The job of the UML specification is to answer questions such as, “How
should we draw an inheritance relationship?” The geranium drawing shown in Figure
11.1 would be drawn in UML as shown in Figure 11.2.
FIGURE11.2
UML drawing of
specialization.
Flower
Geranium
In UML, classes are drawn as rectangles, and inheritance is drawn as a line with an
arrowhead. Interestingly, the arrowhead points from the more specialized class to the
more general class. The direction of the arrow can be counterintuitive, but it doesn’t mat-
ter; as long as we all agree, then after we learn the representation, we can communicate.
The details of the UML are rather straightforward. The diagrams generally are not hard
to use or to understand, and you’ll learn about them as they are presented. Although it is
possible to write a whole book on the UML, the truth is that 90 percent of the time, you
use only a small subset of the UML notation, and that subset is easily learned.
Software Design: The Process ............................................................................
Theprocessof object-oriented analysis and design is much more complex and important
than the modeling language. So, of course, it is ironic that you hear much less about it.