ch05 Old
ch05 Old
CHAPTER 5
UML Overview
This chapter presents an overview of the constituent parts of the UML, how they
relate to one another, and how they contribute to a method or process utilizing
the UML. The chapter provides a framework for understanding:
• An overall view of the constituent parts of the UML.
• How the UML renders knowledge about a problem or solution.
Overview
• How the UML facilitates problem solving and the application of knowledge.
UML
I start with the architecture of the UML and the metamodel that defines the UML. I
then introduce the details of how the UML provides a set of diagrams organized
around architectural views for viewing problems and solutions. I also discuss how
the UML relates to problem solving and how the diagrams may be used. The
complete details of each diagram type are found in the reference chapters.
Architecture
Models are complete abstractions of systems, and diagrams are graphical projec-
tions of models or subsets of models. The UML is defined in a circular manner, in
which a subset of the language notation and semantics is used to specify the
language itself. The UML is defined within a conceptual framework for modeling
that consists of four distinct layers or levels of abstraction (Chapter 3). This frame-
work is based on the most fundamental UML notation that concepts are depicted
as symbols, and relationships among concepts are depicted as paths (lines)
connecting symbols. Both of these types of elements may be named. The concepts
introduced by the UML are organized around architectural views (Chapter 2) to
define the various diagrams. The UML diagrams are used to understand or concep-
tualize a problem, solve the problem, and implement or realize the solution.
To understand the UML architecture, consider how computer programs and
programming languages are related. We develop programs in many different
programming languages (C, C++, Java, etc.), and each particular program is
111
,ch05.17728 Page 112 Wednesday, May 9, 2001 4:02 PM
The association between the Object class and the Class class specifies that each
object must be an instance of one or more classes, and each class may have zero
or more objects.
The next level consists of UML models. This is the level at which modeling of
problems and solutions is done. Figure 5-4 shows that a person can be a member
of only one team, and a team will have zero or more members. This layer is called
the model layer and is used to formalize the concepts for a given subject, in this
case, how people are related to teams. This layer corresponds to class diagrams,
sequence diagrams, or collaboration diagrams.
The next level consists of those elements that exemplify UML models. Figure 5-5
shows that Si, Andy, Phillip, and Nora are all people. Si and Andy are members of
the Requirements team, and Nora and Phillip are members of an unnamed team.
Each object is depicted by specifying and underlining the name of the object
followed by a colon and the class of the object. Each link is depicted by speci-
fying the name of the association on the path connecting the objects. Figure 5-6
shows an ill-formed user model since Si belongs to both teams, whereas our
model of Figure 5-4 shows that a person can only belong to one team. This layer
is called the user model layer and is used to formalize specific expressions about a
given subject, in this case, that Si and Andy belong to the Requirements team and
Nora and Phillip belong to the unnamed team. This layer corresponds to object
diagrams or to scenario diagrams of sequence diagrams or collaboration diagrams.
This brief example demonstrates that a metamodel is capable of defining concepts
and relationships among concepts. However, it is not used to describe the nota-
tion used to render the concepts. Furthermore, because the concepts are defined
Overview
using natural language, they may have various ambiguous interpretations. Thus, a
UML
formal constraint language similar to the Object Constraint Language (OCL) is used
to specify constraints or rules for the concepts within the metamodel, and a nota-
tion guide is used to depict how concepts are rendered. The metamodel used in
this example is not the actual UML metamodel. The UML metamodel is signifi-
cantly more involved and is briefly discussed in the next section.
Architecture 113
,ch05.17728 Page 114 Wednesday, May 9, 2001 4:02 PM
Metamodel
The UML metamodel is organized into a collection of logical packages (Figure 5-
7). Packages are general-purpose grouping mechanisms used to organize semanti-
cally related model elements. The metamodel organizes metamodel elements
within packages. Elements within the same package have strong cohesion with
Overview
UML
each other and loose coupling with elements in other packages. Dashed arrows
between two packages or model elements indicate that a relationship exists
between the elements, where the source of the dashed arrow is dependent on the
presence or existence of the target of the dashed arrow. The UML is defined
within the following packages.
• The Foundation package defines the concepts required for structural model-
ing and the mechanisms for extending the language. These modeling ele-
ments let you model the structure of a system. Other modeling elements
enable the language to be extended. The Foundation package is composed of
the following packages:
Metamodel 115
,ch05.17728 Page 116 Wednesday, May 9, 2001 4:02 PM
– The Data Types package defines different data types used within the UML
metamodel.
– The Core package defines the most fundamental concepts of the UML. It
actually contains sufficient semantics to define the remainder of the UML,
but other packages extend these modeling elements to meet that
purpose. Core concepts include classes and associations. The concepts
within this package are the subject of Chapter 7.
– The Auxiliary Elements package defines other fundamental concepts of
the UML that extend the Core package. These concepts include notes or
comments, dependencies, templates, components, and nodes. The
concepts within this package are appropriately distributed over Chapters
6, 7, 13, and 14 in correlation to how they are used within diagrams.
– The Extension Mechanisms package defines the concepts required to
customize and extend the UML. These concepts are stereotypes, tagged
values, and constraints. The concepts within this package are the subject
of Chapter 15.
• The Behavioral Elements package defines the concepts required to model a
system’s behavior. It is composed of the following packages:
– The Common Behavior package defines the core concepts required for
dynamic elements. It provides the foundation for use cases, collabora-
tions, and state machines. These concepts include signals and actions.
The concepts within this package are appropriately distributed over
Chapters 8, 9, 10, 11, and 12 in correlation to how they are used within
diagrams.
– The Use Cases package defines the modeling of an entity’s functions, or
what it offers to outside users. These concepts include use cases and
actors. The concepts within this package are the subject of Chapter 8.
– The Collaborations package defines how different elements of a model
interact to realize use cases. These concepts include collaborations and
interactions. The concepts within this package are appropriately distrib-
uted over Chapters 9 and 10.
– The State Machines package defines how control and data flow among
elements of a model interacting to realize use cases. These concepts
include events, states, and transitions. The concepts within this package
are appropriately distributed over Chapters 11 and 12.
• The Model Management package defines how modeling elements are orga-
nized. It defines packages as grouping units for other model elements. The
concepts within this package are the subject of Chapter 6.
models that focuses on the problem and solution. The architectural views and their
diagrams are summarized below.
• The user model view encompasses a problem and solution from the perspec-
tive of those individuals whose problem the solution addresses. This view
presents the goals and objectives of the problem owners and their require-
ments of the solution. This view is composed of use case diagrams. These
diagrams describe the functionality provided by a system to external interac-
tors. These diagrams contain actors, use cases, and their relationships. Use
case diagrams are the subject of Chapter 8.
• The structural model view encompasses the static, or structural, aspects of a
Overview
problem and solution. This view is also known as the static or logical view.
UML
This view is composed of the following diagrams:
– Class diagrams describe the static structure of a system, or how it is
declared rather than how it behaves. These diagrams contain classes and
associations.
– Object diagrams describe the static structure of a system at a particular
time during its life. These diagrams contain objects and links.
Class and object diagrams are the subject of Chapter 7.
• The behavioral model view encompasses the dynamic, or behavioral, aspects
of a problem and solution. This view is also known as the dynamic, process,
concurrent, or collaborative view. This view is composed of the following dia-
grams:
– Sequence diagrams render the specification of behavior. These diagrams
describe the behavior provided by a system to interactors. These
diagrams contain classes that exchange messages within an interaction
arranged in time sequence. In generic form, these diagrams describe a set
of message exchange sequences among a set of classes. In instance form
(scenarios), these diagrams describe one actual message exchange
sequence among objects of those classes. Sequence diagrams are the
subject of Chapter 9.
– Collaboration diagrams render how behavior is realized by components
within a system. These diagrams contain classes, associations, and their
Mechanisms
When solving a problem, diagrams are used to communicate information about
the problem and solution. When modeling and diagramming, there are a number
of fundamental mechanisms that enable us to create better or more precise and
communicable models. Thus, mechanisms are means or tools for approaching
modeling and diagramming.
Fundamental to all mechanisms is the idea that information is being communi-
cated for a purpose. When deciding what diagram to use, consider the reason for
the communication. That is, what is the question or questions that the communica-
tion is addressing? Next, consider what diagram or set of diagrams may be used to
most effectively communicate the response. The mechanisms discussed below may
be utilized best if this notion of communication is kept in mind.
The first mechanism involves the perspective through which a diagram is rendered
or interpreted. A perspective (Figure 5-9) defines a particular point of view from
which to draw or read a diagram. The perspective must clearly identify the
diagram’s subject and goal. One of the following three perspectives should be
selected:
Overview
usable form. This is also known as the physical perspective of problem solv-
UML
ing. This perspective addresses the following question: What tools, programs,
or activities will realize the solution?
Once a perspective is selected, it should be made evident on the diagram, perhaps
using a note (Chapter 6) attached to the diagram. When the diagram is inter-
preted, the reader will have a clear viewpoint from which to read it. This makes
communication using the diagram much more effective, and the reader need not
be left guessing as to what perspective was used to render the diagram.
The second mechanism involves the use of various dichotomies. A dichotomy
defines how something may be viewed from two different perspectives. The
following dichotomies are clearly evident:
• The type-instance dichotomy allows a generic descriptor to describe many
individual items. This is the relationship that exists between a class and its
objects, an association and its links, and an interaction and its scenarios. This
dichotomy lets you create object diagrams that are combined into class dia-
grams, or class diagrams that are validated by considering their instantiated
object diagrams. This dichotomy also enables scenario diagrams to validate
sequence and collaboration diagrams.
• The specification-realization dichotomy specifies that knowledge gathered
using the specification perspective is elaborated or translated into the realiza-
tion perspective. This dichotomy allows for the capturing of a specification
before a realization: for example, an operation specification before a method
Mechanisms 119
,ch05.17728 Page 120 Wednesday, May 9, 2001 4:02 PM
The third mechanism involves the use of layers or levels of abstraction through
which a diagram is rendered or interpreted. A layer defines a particular level of
abstraction (Figure 5-10) and establishes a level of detail at which attention and
concentration are focused regarding the subject (problem or solution). The level of
abstraction at which a diagram is drawn or interpreted must be clearly identified.
One of the following layers should be selected:
• The system level specifies the complete services offered by a system to actors.
• Subsystem levels realize the next higher level of services by specifying the
complete services offered by a system or subsystem. Any number of sub-
system levels may be used.
• Class levels realize the next higher level of services by specifying functional
fragments or operations offered by a class. Any number of class levels may be
used.
• The method level realizes the next higher level of services.
This mechanism is crucial for consolidating all the UML diagrams into a coherent
body of knowledge. This mechanism is the key for appropriately using use cases
and is the subject of Chapters 6 and 8.
The final mechanism involves the means for customizing and extending the UML.
These extension mechanisms include the following:
• Stereotypes are used for classifying or marking model elements and introduc-
ing new types of modeling elements.
• Tagged values are used for specifying properties or characteristics of model
elements.
• Constraints are used for specifying semantics or conditions that must be main-
tained as true for model elements.
These extensibility mechanisms are fundamental to ensuring that the UML will
evolve rather than be redefined to meet the changing needs and demands of its
users. They are discussed in Chapter 15.
Overview
Problems, Solutions, and Problem Solving
UML
The UML enables and promotes (but does not require or mandate) a process that
is
• Use case driven, which means that use cases are utilized to
– Capture requirements and define the behavior or services required of a
system by actors, services required of a subsystem by other subsystems,
and operations required of a class by other classes.
– Analyze a problem to address the following questions: What is the
problem? What are the requirements of the problem that its solution must
satisfy?
– Design a solution to address the following question: What are the specifi-
cations of the solution that satisfies the requirements imposed by the
problem?
– Validate the realization of the solution. Use cases that capture the
requirements of the problem are used to validate the solution against the
problem.
– Manage and provide focus for a problem-solving effort. Use cases are
work units that may be distributed over a complete project development
cycle.
• Architecture-centric, which means that architecture is used to
Overview
that a society offers to entities outside the society.
UML
Use case diagrams emphasize functionality, the services offered by a system
to its users.
• The structural model view is composed of the following diagrams:
– Class diagrams emphasize the static structure of a society.
Class diagrams emphasize structure.
– Object diagrams emphasize the static structure of a society at a particular
time during its life. Use these diagrams to exemplify and validate the
static structure of a society.
Object diagrams emphasize examples of structure.
• The behavioral model view is composed of the following diagrams:
– Sequence diagrams emphasize the messages exchanged over time among
the objects within a society. Use scenarios to exemplify and validate
sequence diagrams.
Sequence diagrams emphasize classes and messages.
Scenario sequence diagrams emphasize objects and messages.
– Collaboration diagrams emphasize the messages exchanged over time
among the objects and their links within a society. Use scenarios to
exemplify and validate collaboration diagrams.
Problem Solving
Problems and solutions are societies of objects. Methods specify how problem-
solving efforts may be executed. They specify how knowledge is captured and
communicated regarding a problem and solution, and the approach used to solve
the problem and derive a solution.
Knowledge regarding problems and solutions is communicated using diagrams.
While each diagram emphasizes a particular aspect of the society of objects that
Overview
• The inception (initiating) development phase is primarily concerned with the
UML
conceptualization perspective and focuses on the system level of abstraction.
This phase is used for understanding or forming a notion of the problem and
the rationale for solving it (scoping and business case).
• The elaboration (planning) development phase is concerned with all perspec-
tives and focuses on the system level of abstraction. This phase is used for
– Understanding or forming a notion of the problem to determine the
requirements the problem imposes on its solution.
– Establishing and verifying the foundation for the overall solution.
– Distributing the requirements among the iteration cycles of the construc-
tion phase.
• The construction (executing) development phase is concerned with all per-
spectives and focuses on all levels of abstraction. This phase is used for
– Understanding or evolving the requirements the problem imposes on its
solution so that the problem can be elaborated and the solution can be
specified.
– Elaborating the solution specification.
– Updating the foundation for the overall solution and the foundation
required to support the specific solution for the iteration cycle
requirements.
– Producing the solution for the iteration cycle requirements.
foundation required to support the specific solution for the iteration cycle
requirements.
– The implementation phase is primarily concerned with the realization
perspective and focuses on all levels of abstraction. This phase is for
producing the solution for the iteration cycle requirements.
– The validation (and integration) phase is primarily concerned with the
realization perspective and focuses on all levels of abstraction. This phase
is for verifying the solution for the iteration cycle requirements.
– The deployment phase is primarily concerned with the realization
perspective and focuses on all levels of abstraction. This phase is for
providing and integrating or delivering the solution or a subset thereof.
Overview
UML