Modeling With UML: Understood Among Project Participants. in The Latter Lies The Strength of Standards and
Modeling With UML: Understood Among Project Participants. in The Latter Lies The Strength of Standards and
2
Modeling with UML
23
UML Page 24 Thursday, September 2, 1999 12:25 PM
2.1 Introduction
UML is a notation that resulted from the unification of OMT (Object Modeling Technique,
[Rumbaugh et al., 1991]), Booch [Booch, 1994], and OOSE (Object-Oriented Software
Engineering, [Jacobson et al., 1992]). UML has also been in uenced by other object-oriented
notations, such as those introduced by Shlaer/Mellor [Mellor & Shlaer, 1998], Coad/Yourdon
[Coad et al., 1995], Wirfs-Brock [Wirfs-Brock et al., 1990], and Martin/Odell [Martin & Odell,
1992]. UML has been designed for a broad range of applications. Hence, it provides constructs
for a broad range of systems and activities (e.g., real-time systems, distributed systems, analysis,
system design, deployment). System development focuses on three different models of the
system:
• The functional model, represented in UML with use case diagrams, describes the
functionality of the system from the user’s point of view.
• The object model, represented in UML with class diagrams, describes the structure of a
system in terms of objects, attributes, associations, and operations.
• The dynamic model , represented in UML with sequence diagrams, statechart diagrams,
and activity diagrams, describes the internal behavior of the system. Sequence diagrams
describe behavior as a sequence of messages exchanged among a set of objects, whereas
statechart diagrams describe behavior in terms of states of an individual object and the
possible transitions between states.
In this chapter, we describe UML diagrams for representing these models. Introducing
these notations represents an interesting challenge. On the one hand, understanding the purpose
of a notation requires some familiarity with the activities that use it. On the other hand, it is
necessary to understand the notation before describing the activities. To address this issue, we
introduce UML iteratively. In the next section, we first provide an overview of the five basic
notations of UML. In Section 2.3, we introduce the fundamental ideas of modeling. In
Section 2.4, we revisit the five basic notations of UML in light of modeling concepts. In
subsequent chapters, we examine these notations in detail when we introduce the activities that
use them.
An overview of UML 25
SimpleWatch
ReadTime
SetTime
WatchUser WatchRepairPerson
ChangeBattery
Figure 2-1 A UML use case diagram describing the functionality of a simple watch. The
WatchUser
actor may either consult the time onher watch (with theReadTime use case) or set the time (with the
SetTime use case). However, only the WatchRepairPerson actor may change the battery of the watch
(with the ChangeBattery use case).
Actors are represented with stick figures, use cases with ovals, and the
boundary of the system with a box enclosing the use cases.
SimpleWatch
1 1 11
1 2
21
of the Battery class. The numbers on the ends of associations denote the number of links each
SimpleWatch object can have with
an object of a given class. For example, a SimpleWatch has
exactly two PushButtons, one Display, two Batteries, and one Time. Similarly, all
PushButton, Display, Time, and Battery objects are associated to exactly one SimpleWatch
object.
An overview of UML 27
pressButton1() blinkHours()
pressButton1()
blinkMinutes()
pressButton2()
incrementMinutes()
refresh()
pressButtons1And2()
commitNewTime()
stopBlinking()
button2Pressed
button1&2Pressed
Increment
BlinkHours
Hours
button1Pressed
button2Pressed
button1&2Pressed
Increment
BlinkMinutes
Minutes
button1Pressed
button1&2Pressed
button2Pressed
Increment
BlinkSeconds StopBlinking
Seconds
Figure 2-4 A UML statechart diagram for SetTime use case of the SimpleWatch.