Вы находитесь на странице: 1из 321

www.it-ebooks.

info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
Copyright 2005 O'Reilly Media, Inc. All rights reserved.
ISBN:0-596-00795-7
Pages:234

by Dan Pilone with Neil Pitman

Printed in the United States of America.

Published by O'Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
Table of Contents | Index

O'Reilly books may be purchased for educational, business, or sales promotional use. Online
editions are also available for most titles (safari.oreilly.com). For more information, contact
System
developers have used
languages
decadesortocorporate@oreilly.com.
specify, visualize,
our
corporate/institutional
salesmodeling
department:
(800) for
998-9938
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language
systems.
Essentially, it enables you to
Editor: that applies to a multitude of different
Jonathan
Gennick
communicate solutions in a consistent, tool-supported language.
Production Editor:
Mary Anne Weeks Mayo
Today, UML has become the standard method for modeling software systems, which means
Cover Designer:
Ellie Volckhausen
you're probably confronting this rich and expressive language more than ever before. And
even
though
you may not write UML diagrams
Interior
Designer:
Davidyourself,
Futato you'll still need to interpret
diagrams written by others.
Printing History:

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
June 2005:
First Edition.
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
Nutshell
Handbook, the
Nutshell
logo, and
the O'Reilly logoto
are
This comprehensive
new
edition Handbook
not only provides
a quick-reference
allregistered
UML 2.0 diagram
trademarks
of explains
O'Reilly Media,
Inc. The
a Nutshell
series to
designations,
UML 2.0
in a with
types, it also
key concepts
in In
a way
that appeals
readers already
familiar
Nutshell
the image of a programming
chimpanzee, and
related trade dress are trademarks of O'Reilly
UML or ,object-oriented
concepts.
Media, Inc.
Topics include:
Unified Modeling Language, UML, Model Driven Architecture, MDA, Common Object Request
Broker Architecture, and CORBA are all trademarks of Object Management Group.
The role and value of UML in projects
Many of the designations used by manufacturers and sellers to distinguish their products are
The
paradigm
its relationappear
to the in
UML
claimed
asobject-oriented
trademarks. Where
thoseand
designations
this book, and O'Reilly Media,
Inc. was aware of a trademark claim, the designations have been printed in caps or initial
caps. An integrated approach to UML diagrams

Object, has
Usebeen
Case,taken
Sequence,
Activity,
Component,
While Class
every and
precaution
in the Collaboration,
preparation of Statechart,
this book, the
publisher
and
and
Deployment
Diagrams for errors or omissions, or for damages resulting from the
authors
assume
no responsibility
use of the information contained herein.
Extension Mechanisms
ISBN: 0-596-00795-7
The Object Constraint Language (OCL)
[M]
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

Dedication

...............................................
Publisher:O'Reilly
Pub Date: June 2005
For my family: the
reason I wrote this book and the reason I was able to
ISBN:0-596-00795-7
Pages:234

Dan Pilone

For Laurie Ann:

Table of Contents | Index

Giorraonn beirt bthar/Two people shorten the road

System
developers have used modeling languages for decades to specify, visualize,
Neil
Pitman
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

Preface

...............................................
Publisher:O'Reilly
Pub Date: June 2005
About ThisISBN:
Book0-596-00795-7
Pages:234

How to Use This Book

Typographic Conventions

Table of Contents | Index

Safari Enabled

System
developers
used modeling languages for decades to specify, visualize,
Comments
andhave
Questions
construct, and document systems. The Unified Modeling Language (UML) is one of those
Acknowledgments
languages.
UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
About This
Book
...............................................
Publisher:O'Reilly
Pub Date: June 2005
Welcome to UMLISBN:
2.0 0-596-00795-7
in a Nutshell . The Unified Modeling Language (UML) has expanded quite
Pages:234
a bit since its inception
and can be applied to many different domains, however it still has its

roots in software development. We have tried to make this book applicable to as broad an
audience as possible, but it's helpful to have at least a cursory knowledge of Object Oriented
Table of Contents | (OOP)
Index
Programming
because UML draws much of its terminology from that domain.
Before going any further we'd like to clarify how this book refers to the Unified Modeling
Language.
Grammatically
speaking,
"the languages
UML" is correct.
However,
it sounds
weird. This book
System developers
have used
modeling
for decades
to specify,
visualize,
uses
the
more
colloquial
"UML".
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
UML
2.0 in that
a Nutshell
reference
for the
UML 2.0
Superstructure,
fromyou
a user's
language
appliesistoa adetailed
multitude
of different
systems.
Essentially,
it enables
to
perspective.
Whenever
it
would
be
helpful
to
clarify
a
UML
concept
with
a
concrete
example,
communicate solutions in a consistent, tool-supported language.
we will present Java code.

Today, UML has become the standard method for modeling software systems, which means
In general we assume that you are familiar with OOP and the type of constructs that go with
you're probably confronting this rich and expressive language more than ever before. And
it (classes, methods, inheritance, etc.). However, we make no assumptions about what you
even though you may not write UML diagrams yourself, you'll still need to interpret
know about UML. Each chapter starts with a top-to-bottom discussion of the chapter's topic.
diagrams written by others.
This will be fast paced and thorough, meant for those who understand the basics and want to
know the "nitty-gritty" of a piece of UML. Subsequent sections are kinder, gentler discussions
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
of the topic. This includes examples that show how the topic may be applied to typical
you who must read, create, and understand system artifacts expressed using UML.
problems, help you further refine your models to eliminate ambiguity, capture details that
Furthermore, it's been fully revised to cover version 2.0 of the language.
might otherwise be lost, or add information to your model that aids in tool-based
development.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
A brief word of warning: UML has a strict terminology for just about every aspect of modeling.
UML or object-oriented programming concepts.
This is necessary to reduce ambiguity and confusion as much as possible. However, in
everyday use some terms are used interchangeably with others that have completely different
Topics include:
meanings in UML. A classic example of this is operation and method. These are frequently
treated as being synonymous in a software development environment but have different
meanings
used
in the
context
of UML. We will make a point to use the correct UML term
The when
role and
value
of UML
in projects
even if it may not be the most colloquial name.
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
How to Use
This Book
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:based
0-596-00795-7
This book is divided
on UML diagram type. Obviously there is some crossover, as some
Pages:
234
diagrams build on
concepts
from others. Chapter 1, Fundamentals of UML, covers the basics

of UML and presents some background information that will help you understand the context
for the rest of the book. If you are familiar with previous versions of UML, you can probably
Table ofthis
Contents
| Index If you don't have a strong background in UML, you should definitely start
skim
chapter.
here.
The
next developers
set of chapters
is called
static modeling
in UML.
Static visualize,
modeling captures
System
havecover
used what
modeling
languages
for decades
to specify,
the
physical
structure
of
a
piece
of
software
(as
much
as
software
has
a
"physical"
construct, and document systems. The Unified Modeling Language (UML) is one of structure).
those
For
example:UML
what
operations
and attributes
a class contains,
what interfaces
a class
realizes,
languages.
makes
it possible
for team members
to collaborate
by providing
a common
or
what packages
contain
this mess.
staticsystems.
modelingEssentially,
chapters include:
language
that applies
to aall
multitude
of The
different
it enables you to
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
Chapter 2, Class Diagrams
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
This chapter introduces the class diagram. It discusses the various elements that can be
diagrams written by others.
used on a class diagram, what they represent, and how to extend them. Because class
diagrams are often a centerpiece of a UML model, you should know this chapter inside
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
and out. The last part of the chapter discusses how class diagrams fit into the overall
you who must read, create, and understand system artifacts expressed using UML.
UML model and how the diagrams are typically mapped to code.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive
new edition not only provides a quick-reference to all UML 2.0 diagram
Chapter
3, Package Diagrams
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or
object-oriented
programming
This
chapter introduces
packagesconcepts.
and grouping within a UML model.
Topics include:
Chapter 4, Composite Structures
The role
and introduces
value of UML
projects
This
chapter
theinnew
UML 2.0 concept of composite structures. Composite
structures are specifically designed to represent patterns and are a major new
The object-oriented
paradigm
and its relation to the UML
component
to the modeling
language.
An integrated approach to UML diagrams
Chapter 5, Component Diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment
Diagrams
This
chapter introduces
components and the component diagram. Topics such as the
stereotypes used in component diagrams, relationships between components, and
Extension Mechanisms
component metainformation are discussed. The latter part of this chapter discusses how
components are typically realized in a programming language.
The Object Constraint Language (OCL)
Chapter 6, Deployment Diagrams

If you're new to UML, a tutorial with realistic examples has even been included to help you
This chapter introduces the concept of capturing system deployment using deployment
quickly familiarize yourself with the system.
diagrams. Deployment fundamentals such as nodes, node stereotypes, and
relationships to components are explained. This chapter also includes a discussion on
modeling a distributed system using deployment diagrams.
The next set of chapters cover the second half of UMLbehavioral modeling. Behavioral
modeling captures how the various elements of a system interact during execution. Diagrams

www.it-ebooks.info

such as the use case diagram can capture requirements from an external actor's perspective,
and sequence diagrams can show how objects interact to implement a particular use case.
The behavioral modeling chapters include:
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................

Chapter 7, Use Publisher:


Case Diagrams
O'Reilly

Pub Date: June 2005

This chapter
introduces
use cases, actors, and system boundaries. It goes slightly
ISBN:
0-596-00795-7
beyond pure
UML
in
that
the chapter touches on common practices regarding use cases,
Pages:234
such as use case scoping, use case documents, and use case realizations.
Table of Contents | Index

Chapter 8, Statechart Diagrams


This chapter introduces state machine modeling using states, actions, and transitions.
System developers have used modeling languages for decades to specify, visualize,
Statecharts can be used to model a simple algorithm all the way up to a complex
construct, and document systems. The Unified Modeling Language (UML) is one of those
system.
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate
solutions
in a consistent, tool-supported language.
Chapter
9, Activity
Diagrams

Today,
UML
has become
the standard
methodtofor
software
systems,
whichdiagram.
means
This
chapter
introduces
a close relative
themodeling
statechart
diagram,
the activity
you'reActivity
probably
confronting
this rich
and expressive
language
thanused
evertobefore.
diagrams
resemble
old-school
flowcharts
and aremore
typically
model And
an
even algorithm
though you
not write
UML diagrams yourself, you'll still need to interpret
ormay
use case
realization.
diagrams written by others.
UML 2.010,
in aInteraction
Nutshell from
O'Reilly feels your pain. It's been crafted for professionals like
Chapter
Diagrams
you who must read, create, and understand system artifacts expressed using UML.
Furthermore,
it's been
fully revised
to cover
2.0 of
the language.
This chapter
introduces
the large
set of version
interaction
diagrams
supported by UML 2.0. The
two best-known diagrams are sequence and collaboration diagrams. This chapter also
This comprehensive
newtiming-centric
edition not only
providesdiagram.
a quick-reference to all UML 2.0 diagram
discusses the new
interaction
types, it also explains key concepts in a way that appeals to readers already familiar with
The
part of the bookprogramming
covers extension
and applications of UML 2.0:
UMLfinal
or object-oriented
concepts.
Topics include:
Chapter 11, Tagged Values, Stereotypes, and UML Profiles
The role and value of UML in projects
This chapter discusses how UML 2.0 may be extended and refined.
The object-oriented paradigm and its relation to the UML
Chapter
Effectiveapproach
Diagramming
An12,
integrated
to UML diagrams
This
departs
theSequence,
specification
side of UMLStatechart,
2.0 and offers
real-world
advice
Classchapter
and Object,
Usefrom
Case,
Collaboration,
Activity,
Component,
on
what
parts of UML 2.0 to use when, and how to effectively convey the
andmodeling,
Deployment
Diagrams
right information.
Extension Mechanisms

The A,
Object
Language
(OCL)
Appendix
MDA:Constraint
Model-Driven
Architecture
This appendix introduces the Model-Driven Architecture (MDA). While MDA isn't a new
idea, UML 2.0 has MDA in mind in several places, and next-generation tools may be
If you're
to UML,
a tutorial
with realistic examples has even been included to help you
ablenew
to make
MDA
a reality.
quickly familiarize yourself with the system.
Appendix B, The Object Constraint Language
This appendix describes the Object Constraint Language (OCL), a simple language
defined to express constraints on UML diagrams. It can be applied in countless ways

www.it-ebooks.info

and is introduced here in its basic form.


If you're familiar with the fundamental UML concepts, you can read this book's chapters in
UML
2.0 in a Nutshell
nearly any order.
However,
there is always a certain amount of overlap between chapters
because some elements
can
ByDan Pilone,
Neilappear
Pitman on many diagrams. Instead of repeating the information
in each chapter,...............................................
we fully define elements (and their associated stereotypes, attributes, etc.)
the first time they
are encountered,
and in subsequent chapters, we provide detailed cross
Publisher:
O'Reilly
Date:
June 2005
references backPub
to the
original
definition, when needed.
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
Typographic
Conventions
...............................................
Publisher:O'Reilly
Pub Date: June
2005
The following typographic
conventions
are used in this book:
ISBN:0-596-00795-7
Pages:234

Constant width
Table of Contents | Index

Used in the text to refer to class names, stereotypes, and other elements taken from
UML diagrams.

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
Constant width italic
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
Used in UML diagrams to indicate text that would be replaced by the user.
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
Italic
you're probably confronting this rich and expressive language more than ever before. And
even Used
though
you new
mayterms
not write
diagrams
still references.
need to interpret
when
are UML
introduced,
andyourself,
for URLsyou'll
and file
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
...
you who must read, create, and understand system artifacts expressed using UML.
Ellipses indicate
has 2.0
been
from a diagram for the
Furthermore,
it's beennonessential
fully revisedmaterial
to coverthat
version
ofomitted
the language.
sake of readability.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented
concepts.
Indicates programming
a tip, suggestion,
or general note.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
Indicates an aspect of UML that you must be particularly careful about
using.
An integrated
approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Note that UML makes frequent use of curly braces ({}) and guillemots (). When these are
used in
a syntax Mechanisms
definition, they are required by UML.
Extension
NearlyThe
everything
in UML notation
is optional,
Object Constraint
Language
(OCL) so there is no specific notation to indicate an
optional field. If a particular piece of syntax is required, it is noted in the text.

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
Safari Enabled
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

When you see a Safari Enabled icon on the cover of your favorite technology
book, it means the book is available online through the O'Reilly Network Safari Bookshelf.
Table of Contents | Index

Safari offers a solution that's better than e-books. It's a virtual library that lets you easily
search thousands of top tech books, cut and paste code samples, download chapters, and find
quick
answers
when have
you need
most accurate,
current
information.
Try itvisualize,
for free at
System
developers
usedthe
modeling
languages
for decades
to specify,
http://safari.oreilly.com.
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
Comments
and Questions
...............................................
Publisher:O'Reilly
Pub Date: June
Please address comments
and2005
questions concerning this book to the publisher:
ISBN:0-596-00795-7
Pages:Inc.
234
O'Reilly Media,
1005 Gravenstein Highway North
Sebastopol, CA 95472
Table of Contents
| Index
800-998-9938
(in the United States or Canada)
707-829-0515 (international/local)
707-829-0104 (fax)
System developers have used modeling languages for decades to specify, visualize,
There
is a web
for this
book that
errata,
examples,
or any(UML)
additional
information.
construct,
and page
document
systems.
Thelists
Unified
Modeling
Language
is one
of those
You
can access
pageitat:
languages.
UMLthis
makes
possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
http://www.oreilly.com/catalog/umlnut2
communicate
solutions in a consistent, tool-supported language.

To comment or ask technical questions about this book, send email to:
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
bookquestions@oreilly.com
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams
written by others.
For
more information
about books, conferences, Resource Centers, and the O'Reilly Network,
see the O'Reilly web site at:
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who
must read, create, and understand system artifacts expressed using UML.
http://www.oreilly.com
Furthermore, it's been fully revised to cover version 2.0 of the language.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
Acknowledgments
...............................................

From Dan

Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

This book was truly a team effort. Without support, emails, comments, harassment, and
Table of Contents from
| Indexfriends, family, and colleagues, this book would not have happened. First I'd
suggestions
like to thank my editor, Jonathan Gennick, for his astonishing amount of patience. He is
fantastic to work with and helped keep this book on track.
System developers have used modeling languages for decades to specify, visualize,
Next,
I'd like
to document
thank the systems.
technical The
reviewers
were never
short(UML)
on suggestions
or
construct,
and
Unifiedwho
Modeling
Language
is one of those
comments.
times
I felt
this was
the fourth
edition
of the book,by
after
working
in all their
languages. At
UML
makes
it like
possible
for team
members
to collaborate
providing
a common
ideas.
The that
techapplies
reviewers
Stephen
Mellor, Michael
Chonoles,
Mike
Bernie
language
to awere:
multitude
of different
systems.
Essentially,
it Hudson,
enables you
to
Thuman,
Kimberly
Hamilton,
Russ Miles,tool-supported
and Julie Webster.
communicate
solutions
in a consistent,
language.
Finally,
like
to become
thank my
my method
parents for
for modeling
supporting
me from
the startwhich
and setting
Today, I'd
UML
has
thefamily:
standard
software
systems,
means
an
example
that has
driven me
both
myexpressive
professional
and personal
life, and
wife, And
you're
probably
confronting
thisinrich
and
language
more than
evermy
before.
Tracey,
for somehow
hold
everything
together
while
wrotetothis
book.
even though
you maymanaging
not writeto
UML
diagrams
yourself,
you'll
stillI need
interpret
Compared
to
the
magic
she
has
been
working,
writing
this
book
was
a
piece
of
cake. Last but
diagrams written by others.
not least, I'd like to thank my son Vinny: now we can head to the park!

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore,
From
Neil it's been fully revised to cover version 2.0 of the language.
This
comprehensive
new edition
only provides
quick-reference to
UML 2.0
diagram
I'd
like
to thank Ron Wheeler
andnot
Jacques
Hamel ofaArtifact-Software
forall
allowing
the
use of
types,
it
also
explains
key
concepts
in
a
way
that
appeals
to
readers
already
familiar
with
XML examples. Thanks also to Derek McKee of Mindset Corporation for the use of LamMDA
UML or object-oriented
examples.
Finally, I'd likeprogramming
to especially concepts.
thank Jonathan Gennick for his depth of patience.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

Chapter 1. Fundamentals of UML

...............................................
Publisher:O'Reilly
Pub Date: June 2005
On the surface, ISBN:
the Unified
Modeling Language (UML) is a visual language for capturing
0-596-00795-7
software designs
and
patterns.
Dig a little deeper, though, and you'll find that UML can be
Pages:234

applied to quite a few different areas and can capture and communicate everything from
company organization to business processes to distributed enterprise software. It is intended
to
beof aContents
common
way of capturing and expressing relationships, behaviors, and high-level
Table
| Index
ideas in a notation that's easy to learn and efficient to write. UML is visual; just about
everything in it has a graphical representation. Throughout this book we'll discuss the
meaning behind the various UML elements as well as their representations.
System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
1.1. Getting
Started
...............................................
Publisher:O'Reilly
Date:
June
2005be sure to read this chapter all the way through to get
If you're new toPub
UML,
you
should
0-596-00795-7
acquainted withISBN:
the basic
terminology used throughout the book. If you are a developer, class
Pages:
234simplest diagrams to start with because they map closely to code.
diagrams tend to
be the
Pick a program or domain you know well, and try to capture the entities involved using
classes. Once you're convinced you've modeled the relationships between your entities
Table of Contents
correctly,
pick| Index
a piece of functionality and try to model that using a sequence diagram and
your classes.

IfSystem
you're developers
more of a process
person
(business
or otherwise),
you to
may
be more
comfortable
have used
modeling
languages
for decades
specify,
visualize,
starting
with
andocument
activity diagram.
Chapter
9 shows
examples
of modeling
construct,
and
systems.
The Unified
Modeling
Language
(UML) business
is one of processes
those
with
different
groups
(Human
Resources,
IT,members
etc.) and to
progresses
to by
modeling
parallel
languages.
UML
makes
it possible
for team
collaborate
providing
a common
processes
different
language over
that applies
togeographic
a multituderegions.
of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
1.2. Background
...............................................
Publisher:O'Reilly
Pub
Date:
UML has become
the
de June
facto 2005
standard for modeling software applications and is growing in
ISBN:0-596-00795-7
popularity in modeling
other domains. Its roots go back to three distinct methods: the Booch
Pages:
234 the Object Modeling Technique coauthored by James Rumbaugh, and
Method by Grady
Booch,
Objectory by Ivar Jacobson. Known as the Three Amigos, Booch, Rumbaugh, and Jacobson
kicked off what became the first version of UML, in 1994. In 1997, UML was accepted by the
Table of Contents
| Index
Object
Management
Group (OMG) and released as UML v1.1.

Since then, UML has gone through several revisions and refinements leading up to the current
2.0
release.
Each revision
has tried
to address
problems
and shortcomings
identified in the
System
developers
have used
modeling
languages
for decades
to specify, visualize,
previous
versions,
leading systems.
to an interesting
expansion
andLanguage
contraction
of the
language.
UML
construct,
and document
The Unified
Modeling
(UML)
is one
of those
2.0
is by far UML
the largest
specification
in members
terms of page
count (theby
superstructure
alone is
languages.
makes UML
it possible
for team
to collaborate
providing a common
over
600 pages),
but itto
represents
theofcleanest,
compact
version it
ofenables
UML yet.
language
that applies
a multitude
differentmost
systems.
Essentially,
you to
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


Dan Pilone,Neil Pitman
1.3. UML By
Basics
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
First and foremost,
it0-596-00795-7
is important to understand that UML is a language . This means it has
234
both syntax andPages:
semantics.
When you model a concept in UML, there are rules regarding how

the elements can be put together and what it means when they are organized in a certain
way. UML is intended not only to be a pictorial representation of a concept, but also to tell you
Table of Contents
| Index
something
about
its context. How does widget 1 relate to widget 2? When a customer orders
something from you, how should the transaction be handled? How does the system support
fault tolerance and security?
System developers have used modeling languages for decades to specify, visualize,
You
can apply
in any systems.
number ofThe
ways,
but common
include:
construct,
andUML
document
Unified
Modeling uses
Language
(UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
Designing software
communicate solutions in a consistent, tool-supported language.
Communicating software or business processes
Today, UML has become the standard method for modeling software systems, which means
you're
probablydetails
confronting
rich and
language
more than ever before. And
Capturing
about this
a system
for expressive
requirements
or analysis
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams
written by
Documenting
anothers.
existing system, process, or organization

UML has
2.0 been
in a Nutshell
from
O'Reillydomains,
feels yourincluding:
pain. It's been crafted for professionals like
UML
applied to
countless
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
Banking and investment sectors
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
Health
care
types,
it also
explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Defense
Topics include:
Distributed computing
Embedded systems
The role and value of UML in projects
Retail sales and supply
The object-oriented paradigm and its relation to the UML
The basic building block of UML is a diagram. There are several types, some with very specific
An integrated approach to UML diagrams
purposes (timing diagrams) and some with more generic uses (class diagrams). The following
sections
touch
some of
the
major
ways UML
has been employed.
TheActivity,
diagrams
mentioned
Class
andon
Object,
Use
Case,
Sequence,
Collaboration,
Statechart,
Component,
in each
section
are by no
means confined to that section. If a particular diagram helps you
and
Deployment
Diagrams
convey your message you should use it; this is one of the basic tenants of UML modeling.
Extension Mechanisms

Object Constraint
Language (OCL)
1.3.1.The
Designing
Software
Because UML grew out of the software development domain, it's not surprising that's where it
still
finds its
greatest
When with
applied
to software,
UML
attempts
to bridge
thetogap
between
If you're
new
to UML,use.
a tutorial
realistic
examples
has
even been
included
help
you
the
original
idea foryourself
a piece with
of software
and its implementation. UML provides a way to
quickly
familiarize
the system.
capture and discuss requirements at the requirements level (use case diagrams), sometimes
a novel concept for developers. There are diagrams to capture what parts of the software
realize certain requirements (collaboration diagrams). There are diagrams to capture exactly
how those parts of the system realize their requirements (sequence and statechart diagrams).
Finally there are diagrams to show how everything fits together and executes (component and

www.it-ebooks.info

deployment diagrams).
Books describing previous versions of UML made a point to emphasize that UML was not a
UML 2.0
in a Nutshell
visual programming
language;
you couldn't execute your model. However, UML 2.0 changes
the rules somewhat.
the
major motivations for the move from UML 1.5 to UML 2.0 was
ByDan One
Pilone,of
Neil
Pitman
to add the ability
for modelers to capture more system behavior and increase tool
...............................................
automation. A relatively
new technique called Model Driven Architecture (MDA) offers the
Publisher:O'Reilly
Pub Date:
June 2005
potential to develop
executable
models that tools can link together and to raise the level of
ISBN:
0-596-00795-7
abstraction above
traditional
programming languages. UML 2.0 is central to the MDA effort.
Pages:234

It is important to realize the UML is not a software process. It is meant to be used within a
software process and has facets clearly intended to be part of an iterative development
Table of Contents | Index
approach.
While UML was designed to accommodate automated design tools, it wasn't intended only for
tools.
Professional
were kept
in mind for
when
UML was
designed,
so the language
System
developerswhiteboarders
have used modeling
languages
decades
to specify,
visualize,
lends
itself
to
quick
sketches
and
capturing
"back
of
the
napkin"
type
designs.
construct, and document systems. The Unified Modeling Language (UML) is one of those

languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate
solutions
in a consistent,
tool-supported language.
1.3.2.
Business
Process
Modeling
Today, UML has become the standard method for modeling software systems, which means
you're
confronting
this rich
and expressive
language
more than
before.
And
UML
hasprobably
an extensive
vocabulary
for capturing
behavior
and process
flow.ever
Activity
diagrams
even
though
you
may
not
write
UML
diagrams
yourself,
you'll
still
need
to
interpret
and statecharts can be used to capture business processes involving individuals, internal
diagrams
by others.
groups,
or written
even entire
organizations. UML 2.0 has notation that helps model geographic
boundaries (activity partitions), worker responsibilities (swim lanes), and complex
UML 2.0 in a (statechart
Nutshell from
O'Reilly feels your pain. It's been crafted for professionals like
transactions
diagrams).
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


Dan Pilone,Neil Pitman
1.4. UML By
Specifications
...............................................
Publisher:O'Reilly
June
2005
Physically, UML Pub
is aDate:
set of
specifications
from the OMG. UML 2.0 is distributed as four
ISBN:
0-596-00795-7
specifications: the
Diagram
Interchange Specification, the UML Infrastructure, the UML
234Object Constraint Language (OCL). All of these specifications are
Superstructure,Pages:
and the
available from the OMG web site, http://www.omg.org.
Table of
Contents |Interchange
Index
The
Diagram
Specification was written to provide a way to share UML models
between different modeling tools. Previous versions of UML defined an XML schema for
capturing what elements were used in a UML diagram, but did not capture any information
about
how
a diagramhave
was used
laid out.
To address
this, for
the decades
Diagramto
Interchange
Specification
System
developers
modeling
languages
specify, visualize,
was
developed
with systems.
a mapping
from
a new
XML schema
to a Scalable
construct,
and along
document
The
Unified
Modeling
Language
(UML) is Vector
one of Graphics
those
(SVG)
representation.
Typically
thefor
Diagram
Interchange
Specification
used only
by tool
languages.
UML makes
it possible
team members
to collaborate
byisproviding
a common
vendors,
the OMG
an effort
to include
"whiteboard
tools."
languagethough
that applies
to amakes
multitude
of different
systems.
Essentially,
it enables you to
communicate solutions in a consistent, tool-supported language.
The UML Infrastructure defines the fundamental, low-level, core, bottom-most concepts in
UML;
theUML
infrastructure
is the
a metamodel
that is used
to produce
the rest
of UML.which
The means
Today,
has become
standard method
for modeling
software
systems,
infrastructure
isn't
typically used
by an
end
user, but language
it providesmore
the foundation
for the And
UML
you're probably
confronting
this rich
and
expressive
than ever before.
Superstructure.
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
The UML Superstructure is the formal definition of the elements of UML, and it weighs in at
over
pages.
This isfrom
the authority
on all
thatpain.
is UML,
least
as farfor
as professionals
the OMG is like
UML 600
2.0 in
a Nutshell
O'Reilly feels
your
It's at
been
crafted
concerned.
The read,
superstructure
documentation
is typically
usedexpressed
by tool vendors
and those
you who must
create, and
understand system
artifacts
using UML.
writing
books on
some effort
hasversion
been made
make
it human readable.
Furthermore,
it'sUML,
beenthough
fully revised
to cover
2.0 oftothe
language.

The OCL specification defines a simple language for writing constraints and expressions for
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
elements in a model. The OCL is often brought into play when you specify UML for a particular
types, it also explains key concepts in a way that appeals to readers already familiar with
domain and need to restrict the allowable values for a parameter or object. Appendix B is an
UML or object-oriented programming concepts.
overview of the OCL.

Topics include:
It is important to realize that while the specification is the definitive source of the formal
definition of UML, it is by no means the be-all and end-all of UML. UML is designed to be
extended
depending
on the domain, user, and specific application. There is
The and
role interpreted
and value of
UML in projects
enough wiggle room in the specification to fit a data center through it... this is intentional. For
example,
are typically
two or more
ways
to represent
a UML concept depending on what
The there
object-oriented
paradigm
and its
relation
to the UML
looks best in your diagram or what part of a concept you wish to emphasize. You may choose
to represent
a particular
element
using
an in-house notation; this is perfectly acceptable as
An integrated
approach
to UML
diagrams
far as UML is concerned. However, you must be careful when using nonstandard notation
Class
Object,
Usefor
Case,
Sequence,
Collaboration,
Activity, Component,
because
partand
of the
reason
using
UML in the
first place is Statechart,
to have a common
and Deployment
Diagrams with other users.
representation
when collaborating
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
1.5. Putting
UML to Work
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
A UML model provides
a view of a systemoften just one of many views needed to actually
Pages:
build or document
the234
complete system. Users new to UML can fall into the trap of trying to

model everything about their system with a single diagram and end up missing critical
information. Or, at the other extreme, they may try to incorporate every possible UML
Table of Contents
Index model, thereby overcomplicating things and creating a maintenance
diagram
into |their
nightmare.
Becoming
proficient have
with UML
understanding
what
each diagram
hasvisualize,
to offer and
System developers
usedmeans
modeling
languages for
decades
to specify,
knowing
when
to
apply
it.
There
will
be
many
times
when
a
concept
could
be
expressed
construct, and document systems. The Unified Modeling Language (UML) is one
of thoseusing
any
number UML
of diagrams;
the one(s)
that
will mean
most to by
your
users. a common
languages.
makes it pick
possible
for team
members
to the
collaborate
providing
language that applies to a multitude of different systems. Essentially, it enables you to
Each
chapter ofsolutions
this book
a type
of diagram and
gives examples of its use. There
communicate
indescribes
a consistent,
tool-supported
language.
are times when you may need to have more than one diagram to capture all the relevant
details
a single
part of the
your
system.method
For example,
you may
need asystems,
statechart
diagram
to
Today,for
UML
has become
standard
for modeling
software
which
means
show
how
an embedded
controller
processes
input from
a user more
as well
as aever
timing
diagram
you're
probably
confronting
this rich
and expressive
language
than
before.
And to
show
the you
controller
interacts
withdiagrams
the rest of
the system
a result
of that
input.
even how
though
may not
write UML
yourself,
you'llasstill
need to
interpret

diagrams written by others.


You should also consider your audience when creating models. A test engineer may not care
about the low-level implementation (sequence diagram) of a component, only the external
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
interfaces it offers (component diagram). Be sure to consider who will be using each diagram
you who must read, create, and understand system artifacts expressed using UML.
you produce and make it meaningful to that person.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram

types, itUML
also explains
key concepts in a way that appeals to readers already familiar with
1.5.1.
Profiles
UML or object-oriented programming concepts.

Topics
include:
In
addition
to a variety of diagram types, UML is designed to be extended. You can informally
extend UML by adding constraints, stereotypes, tagged values, and notes to your models, or
you can use the formal UML extension and define a full UML profile . A UML profile is a
The of
role
and value and
of UML
in projects
collection
stereotypes
constraints
on elements that map the otherwise generic UML to
a specific problem domain or implementation. For example, there are profiles for CORBA,
The object-oriented paradigm and its relation to the UML
Enterprise Application Integration (EAI), fault tolerance, database modeling, and testing. See
Chapter
for moreapproach
information
on UML
2.0 Profiles.
An11
integrated
to UML
diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
1.6. Modeling
...............................................
Publisher:O'Reilly
Pub Date:
June
2005
It should go without
saying
that
the focus of UML is modeling. However, what that means,
0-596-00795-7
exactly, can be ISBN:
an open-ended
question. Modeling is a means to capture ideas, relationships,
Pages:234
decisions, and requirements
in a well-defined notation that can be applied to many different
domains. Modeling not only means different things to different people, but also it can use
different pieces of UML depending on what you are trying to convey.
Table of Contents | Index

In general a UML model is made up of one or more diagrams . A diagram graphically


represents things, and the relationships between these things. These things can be
representations
of real-world
pure
softwarefor
constructs,
or specify,
a description
of the
System developers
have usedobjects,
modeling
languages
decades to
visualize,
behavior
of and
some
other object.
It is The
common
forModeling
an individual
thing (UML)
to show
construct,
document
systems.
Unified
Language
is up
oneon
ofmultiple
those
diagrams;
a particular
interest,
or view , of by
theproviding
thing being
modeled.
languages.each
UMLdiagram
makes itrepresents
possible for
team members
to collaborate
a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

1.6.1. Diagrams

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
UML 2.0 divides diagrams into two categories: structural diagrams and behavioral diagrams .
diagrams written by others.
Structural diagrams are used to capture the physical organization of the things in your
systemi.e., how one object relates to another. There are several structural diagrams in UML
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
2.0:
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive
new edition not only provides a quick-reference to all UML 2.0 diagram
Class
diagrams
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or
object-oriented
concepts. to capture details about the entities that
Class
diagrams useprogramming
classes and interfaces
make up your system and the static relationships between them. Class diagrams are
Topicsone
include:
of the most commonly used UML diagrams, and they vary in detail from fully
fleshed-out and able to generate source code to quick sketches on whiteboards and
napkins. Class diagrams are discussed in Chapter 2.
The role and value of UML in projects
The object-oriented
paradigm and its relation to the UML
Component
diagrams
An integrated
approach
to UML
Component
diagrams
show
the diagrams
organization and dependencies involved in the
implementation of a system. They can group smaller elements, such as classes, into
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
larger, deployable pieces. How much detail you use in component diagrams varies
and Deployment Diagrams
depending on what you are trying to show. Some people simply show the final,
deployable
version of a system, and others show what functionality is provided by a
Extension Mechanisms
particular component and how it realizes its functionality internally. Component
diagrams
discussedLanguage
in Chapter
5.
The Objectare
Constraint
(OCL)
Composite structure diagrams
If you're new to UML, a tutorial with realistic examples has even been included to help you
Composite
structure
new to UML 2.0. As systems become more complex,
quickly
familiarize
yourselfdiagrams
with the are
system.
the relationships between elements grow in complexity as well. Conceptually, composite
structure diagrams link class diagrams and component diagrams; they don't emphasize
the design detail that class diagrams do or the implementation detail that composite
structures do. Instead, composite structures show how elements in the system combine
to realize complex patterns. Composite structures are discussed in Chapter 4.

www.it-ebooks.info

Deployment diagrams
UML 2.0 in a Nutshell

Deployment
diagrams
ByDan
Pilone,Neilshow
Pitmanhow your system is actually executed and assigned to
various pieces
of hardware. You typically use deployment diagrams to show how
...............................................
components
are configured
at runtime. Deployment diagrams are discussed in Chapter
Publisher:
O'Reilly
6.
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Package diagrams
Package
diagrams
Table of Contents
| Index

are really special types of class diagrams. They use the same
notation but their focus is on how classes and interfaces are grouped together. Package
diagrams are discussed in Chapter 3.

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
Object diagrams
languages. UML makes it possible for team members to collaborate by providing a common
language
that
applies to
a the
multitude
of different
systems.
Essentially,
it enables
youinstances
to
Object
diagrams
use
same syntax
as class
diagrams
and show
how actual
communicate
solutions
in
a
consistent,
tool-supported
language.
of classes are related at a specific instance of time. You use object diagrams to show
snapshots of the relationships in your system at runtime. Object diagrams are discussed
Today,
become
the standard
method
asUML
parthas
of class
diagrams
in Chapter
2. for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though
you may
not on
write
diagrams
yourself,inyou'll
still need
interpret
Behavioral
diagrams
focus
theUML
behavior
of elements
a system.
For to
example,
you can use
diagrams
written
by
others.
behavioral diagrams to capture requirements, operations, and internal state changes for
elements. The behavioral diagrams are:
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
Activity diagrams
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
capture
the flow
one appeals
behaviortoorreaders
activity already
, to the familiar
next. They
types,Activity
it also diagrams
explains key
concepts
in a from
way that
withare
similar
in concept to
a classic flowchart,
but are much more expressive. Activity
UML or
object-oriented
programming
concepts.
diagrams are discussed in Chapter 9.
Topics include:
Communication diagrams
The role and value of UML in projects
Communication diagrams are a type of interaction diagram that focuses on the
The object-oriented
andbehavior
its relation
the messages
UML
elements
involved inparadigm
a particular
andtowhat
they pass back and
forth. Communication diagrams emphasize the objects involved more than the order
An integrated
approach
to UML
diagramsCommunication diagrams are discussed as part
and
nature of the
messages
exchanged.
of interaction diagrams in Chapter 10.
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Interaction overview diagrams
Extension Mechanisms
Interaction overview diagrams are simplified versions of activity diagrams. Instead of
The Object Constraint
Language
emphasizing
the activity
at each (OCL)
step, interaction overview diagrams emphasize which
element or elements are involved in performing that activity. The UML specification
describes interaction diagrams as emphasizing who has the focus of control throughout
the execution of a system. Interaction overview diagrams are discussed as part of
If you're new to UML, a tutorial with realistic examples has even been included to help you
interaction diagrams in Chapter 10.
quickly familiarize yourself with the system.
Sequence diagrams
Sequence diagrams are a type of interaction diagram that emphasize the type and
order of messages passed between elements during execution. Sequence diagrams are

www.it-ebooks.info

the most common type of interaction diagram and are very intuitive to new users of
UML. Sequence diagrams are discussed as part of interaction diagrams in Chapter 10.
UML 2.0 in a Nutshell

State machine diagrams


ByDan Pilone,Neil Pitman
...............................................

State machine
diagrams
Publisher:
O'Reillycapture the internal state transitions of an element. The
element could
be as
small
as a single class or as large as the entire system. State
Pub Date:
June
2005
machine diagrams
are commonly used to model embedded systems and protocol
ISBN:0-596-00795-7
Pages:
specifications
or234
implementations. State machine diagrams are discussed in Chapter 8.

Timing
diagrams
Table of Contents
| Index
Timing diagrams are a type of interaction diagram that emphasize detailed timing
specifications
messages.
They are
often used
to modelto
real-time
System
developers for
have
used modeling
languages
for decades
specify, systems
visualize,such as
satellite
communication
or
hardware
handshaking.
They
have
specific
to
construct, and document systems. The Unified Modeling Language (UML) is notation
one of those
indicate
how
long a
process
or respond
to messages,
and howa external
languages.
UML
makes
it system
possiblehas
for to
team
members
to collaborate
by providing
common
interruptions
are to
factored
into execution.
diagrams
are discussed
asyou
parttoof
language
that applies
a multitude
of differentTiming
systems.
Essentially,
it enables
interaction
diagrams
in
Chapter
10.
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
Use case diagrams
you're probably confronting this rich and expressive language more than ever before. And
even Use
though
may not
write UML
diagrams
yourself, you'll
needThey
to interpret
caseyou
diagrams
capture
functional
requirements
for a still
system.
provide an
diagrams
written
by
others.
implementation-independent view of what a system is supposed to do and allow the
modeler to focus on user needs rather than realization details. Use case diagrams are
UML 2.0
in a Nutshell
from7.
O'Reilly feels your pain. It's been crafted for professionals like
discussed
in Chapter
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

1.6.2.
Views
This comprehensive
new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
While not strictly part of UML itself, the concept of views of a system helps the modeler
choose
Topics diagrams
include: that help convey the correct information depending on his goals.
Specifically, models are often divided into what is called the 4+1 views of a system. The 4+1
notation represents four distinct views of a system and one overview of how everything fits
The The
rolefour
and views
value are:
of UML in projects
together.
The object-oriented paradigm and its relation to the UML
integrated approach to UML diagrams
DesignAn
view
Classdesign
and Object,
Use Case,
Collaboration,
Statechart,
The
view captures
theSequence,
classes, interfaces,
and patterns
thatActivity,
describeComponent,
the
and Deployment
representation
of Diagrams
the problem domain and how the software will be built to address it.
The design view almost always uses class diagrams, object diagrams, activity diagrams,
Extension Mechanisms
composite
structure diagrams, and sequence diagrams to convey the design of a
system. The design view typically doesn't address how the system will be implemented
The Object Constraint Language (OCL)
or executed.

Deployment view
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.
The deployment view captures how a system is configured, installed, and executed. It
often consists of component diagrams, deployment diagrams, and interaction diagrams.
The deployment view captures how the physical layout of the hardware communicates
to execute the system, and can be used to show failover, redundancy, and network
topology.

www.it-ebooks.info

Implementation view
The implementation
view emphasizes the components, files, and resources used by a
UML 2.0 in a Nutshell
system. Typically
the
implementation view focuses on the configuration management of
ByDan Pilone,Neil Pitman
a system; what components depend on what, what source files implement what classes,
...............................................
etc. Implementation
views almost always use one or more component diagrams and
Publisher:O'Reilly
may include
diagrams, statechart diagrams, and composite structure
Pub interaction
Date: June 2005
diagrams.ISBN:0-596-00795-7
Pages:234

Process view
Table of Contents | Index

The process view of a system is intended to capture concurrency, performance, and


scalability information. Process views often use some form of interaction diagrams and
activity diagrams to show how a system actually behaves at runtime.
System developers have used modeling languages for decades to specify, visualize,
construct,
and document
Thebrought
Unified Modeling
Language
(UML)
is one of those
The
four distinct
views of asystems.
system are
together with
the final
view:
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Use case view
Today, UML has become the standard method for modeling software systems, which means
use case
view captures
the and
functionality
required
by the
end
users.
concept
you'reThe
probably
confronting
this rich
expressive
language
more
than
everThe
before.
Andof
users
is may
deliberately
broad
the use yourself,
case view;
theystill
include
primary
even end
though
you
not write
UML in
diagrams
you'll
need the
to interpret
stakeholders,
system administrator, the testers, and potentially the developers
diagrams
written bythe
others.
themselves. The use case view is often broken down into collaborations that link a use
case
one or from
moreO'Reilly
of the four
Thebeen
use case
view
use case
UML 2.0
in with
a Nutshell
feelsbasic
yourviews.
pain. It's
crafted
forincludes
professionals
like
diagrams
and typically
usesunderstand
several interaction
diagramsexpressed
to show use
case
details.
you who
must read,
create, and
system artifacts
using
UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

This comprehensive
new edition not only provides a quick-reference to all UML 2.0 diagram
1.6.3.
Notes
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

UML provides a catchall element, or note, for adding information to your diagram. The note
Topics include:
symbol is a dog-eared rectangle with an optional dashed line to link it to some element.
Figure 1-1 shows a simple note.

The role and value of UML in projects


The object-oriented paradigm and its relation to the UML

Figure 1-1. A simple note


An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
In
general,
you canyourself
use notes
to the
capture
just about anything in your diagram. Notes are often
quickly
familiarize
with
system.
used to express additional information that either doesn't have its own notation or would
clutter a diagram if you drew it right on the element. Some tools allow you to embed URL
links in notes, providing an easy way to navigate from one diagram to the next, or to HTML
documents, etc.

www.it-ebooks.info

1.6.4. Classifiers and Adornments


UML 2.0
in a Nutshell
The basic modeling
element
in UML is the classifier . A classifier represents a group of things
with common properties.
at the level of classifier, we are discussing UML itself,
ByDan Pilone,Remember,
Neil Pitman
not a particular ...............................................
system. So, when we say a class is a classifier, we mean that classes are
things that havePublisher:
common
properties: methods, attributes, exceptions, visibility, etc. A specific
O'Reilly
class, such as Automobile
, isn't
a UML classifier; it's an instance of a classifier, or a class.
Pub Date: June
2005
ISBN:0-596-00795-7
Pages:234

Table of Contents

For the truly self-abusing, this is a glimpse into the UML meta-model .
The full metamodel is quite complex and begins with the UML
| Index
infrastructure specification.

System developers have used modeling languages for decades to specify, visualize,
document
systems.
The Unified
Language
is one of to
those
Aconstruct,
classifier'sand
generic
notation
is a rectangle
thatModeling
can be divided
into (UML)
compartments
show
languages. UML makes
it possible
team members
to collaborate
providingHowever,
a common
classifier-specific
information,
such for
as operations,
attributes,
or stateby
activities.
language
appliessuch
to aas
multitude
of different
systems.
Essentially,
it enables
youtotohelp
many
UML that
classifiers
states, activities,
objects,
etc.,
have custom
notations
communicate
solutions
in a consistent, tool-supported language.
distinguish
them
visually.
AToday,
classifier
can
have
several
of extra
information
attached
to it via
a UML which
mechanism
UML
has
become
thetypes
standard
method
for modeling
software
systems,
means
called
adornments
. For example,
can have restrictions
placed
onever
the values
you're
probably confronting
this classifiers
rich and expressive
language more
than
before.aAnd
feature
of the you
classifier
canwrite
take.UML
In general,
constraints
written
neartothe
classifier or in an
even though
may not
diagrams
yourself, are
you'll
still need
interpret
attached
Seeby
the
specific diagram types for details on what notation to use for a
diagramsnote.
written
others.
constraint when writing it near the classifier.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
Another
of read,
adornment
a stereotype
. Just
as you
would expressed
expect, a stereotype
you whotype
must
create,isand
understand
system
artifacts
using UML.is intended
to
give the reader
a general
of what
a particular
classifier
Furthermore,
it's been
fully idea
revised
to cover
version 2.0
of therepresents.
language. Stereotypes are
usually associated with implementation concepts, such as TRansactional or singleton,
though
that isn't required
by the UML
specification.
This comprehensive
new edition
not only
provides a quick-reference to all UML 2.0 diagram

types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


Dan Pilone,Neil Pitman
1.7. UML By
Rules
of Thumb
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:a0-596-00795-7
While UML provides
common language for capturing functionality and design information, it
Pages:234 to allow for the flexibility needed to model different domains.
is deliberately open-ended

There are several rules of thumb to keep in mind when using UML:
Table of Contents | Index

Nearly everything in UML is optional

System developers have used modeling languages for decades to specify, visualize,
UML provides a language to capture information that varies greatly depending on the
construct, and document systems. The Unified Modeling Language (UML) is one of those
domain of the problem. In doing that, there are often parts of UML that either don't
languages. UML makes it possible for team members to collaborate by providing a common
apply to your particular problem or may not lend anything to the particular view you are
language that applies to a multitude of different systems. Essentially, it enables you to
trying to convey. It is important to realize that you don't need to use every part of UML
communicate solutions in a consistent, tool-supported language.
in every model you create. Possibly even more importantly, you don't need to use every
allowable symbol for a diagram type in every diagram you create. Show only what helps
Today, UML has become the standard method for modeling software systems, which means
clarify the message you are trying to convey, and leave off what you don't need. At
you're probably confronting this rich and expressive language more than ever before. And
times there is more than one way to convey the same information; use what is familiar
even though you may not write UML diagrams yourself, you'll still need to interpret
to your audience.
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
UML models are rarely complete
you who must read, create, and understand system artifacts expressed using UML.
Furthermore,
it's been fully
revised tobeing
coveroptional,
version 2.0
the language.
As a consequence
of everything
it isofcommon
for a UML model to be
missing some details about a system. The trick is to not miss key details that could
This comprehensive
new edition
only provides
a key
quick-reference
all UML 2.0information
diagram
impact your system
design.not
Knowing
what is a
detail versustoextraneous
types,comes
it alsowith
explains
key
concepts
in
a
way
that
appeals
to
readers
already
familiar
experience; however, using an iterative process and revisiting your with
model
UML or
object-oriented
programming
helps
to flesh out what
needs to concepts.
be there. As UML moves closer to tool automation with
practices like MDA and Software Factories, the models often become more and more
Topicsdetailed
include:
and therefore complete. The difference is the tool support that helps vary the
level of abstraction depending on your needs.

The role and value of UML in projects


UML is designed to be open to interpretation
The object-oriented paradigm and its relation to the UML
While the UML specification does a good job of laying down the groundwork for a
An integrated approach to UML diagrams
modeling language, it is critical that within an organization or group of users you
establish
and Use
when
to use
a language
feature. ForStatechart,
example, some
organizations
Class andhow
Object,
Case,
Sequence,
Collaboration,
Activity,
Component,
use
aggregation
relationship to indicate a C++ pointer and a composition
and an
Deployment
Diagrams
relationship to indicate a C++ reference. There is nothing inherently wrong with this
distinction,
but it's something that isn't going to be immediately obvious to someone
Extension Mechanisms
not familiar with that organization's modeling technique. It is a good practice to put
together
a document
modeling
guidelines; it helps novice users get up to speed
The Object
Constrainton
Language
(OCL)
quicker and helps experienced users really think about how they represent something
and consider a potentially better notation.

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly
familiarize
with the system.
UML
is intended
toyourself
be extended
UML includes several mechanisms to allow customization and refinement of the
language. Such mechanisms as adornments, constraints, and stereotypes provide ways
to capture specific details that aren't easily expressed using classifiers and
relationships. Typically these are grouped into what are known as UML profiles . For

www.it-ebooks.info

example, you can put together a Java 2 Enterprise Edition (J2EE) profile that includes
stereotypes for sessionbean or javadataobject. If you are modeling a complex domain,
consider putting together a UML profile that lets you easily identify elements as
UML
2.0 in
a Nutshellsuch as mutualfund or securitymonitor.
concepts in
your
domain,
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

Chapter 2. Class Diagrams

...............................................
Publisher:O'Reilly
Pub Date: June 2005
Class diagrams ISBN:
are one
of the most fundamental diagram types in UML. They are used to
0-596-00795-7
capture the static
relationships
of your software; in other words, how things are put together.
Pages:234

When writing software you are constantly making design decisions: what classes hold
references
to other classes, which class "owns" some other class, and so on. Class diagrams
Table of Contents | Index
provide a way to capture this "physical" structure of a system.

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
2.1. Classes
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
A class represents
a 0-596-00795-7
group of things that have common state and behavior. You can think of a
Pages:
234
class as a blueprint
for
an object in an object-oriented system. In UML speak, a class is a kind

ofclassifier . For example, Volkswagen, Toyota, and Ford are all cars, so you can represent
them using a class named Car. Each specific type of car is an instance of that class, or an
Table of Contents
| Index
object
. A class
may represent a tangible and concrete concept, such as an invoice; it may be
abstract, such as a document or a vehicle (as opposed to an invoice, or a motorcycle greater
than 1000 cc), or it may represent an intangible concept such as a high-risk investment
strategy.
System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
You
represent
a class
with
a rectangular
boxmembers
divided into
compartments
. A compartment
is
languages.
UML
makes
it possible
for team
to collaborate
by providing
a common
simply
an area
in the rectangle
to write
The first
compartment
holdsyou
the to
name of
language
that applies
to a multitude
of information.
different systems.
Essentially,
it enables
the
class, the second
holds
(see
"Attributes"),language.
and the third is used for operations
communicate
solutions
in aattributes
consistent,
tool-supported
(see "Operations"). You can hide any compartment of the class if that increases the
readability
of has
yourbecome
diagram.
reading
a diagram,
you can
make no
assumptions
Today, UML
theWhen
standard
method
for modeling
software
systems,
which about
meansa
missing
compartment;
it doesn't
it isexpressive
empty. You
may add
compartments
to a class
you're probably
confronting
this mean
rich and
language
more
than ever before.
Andto
show
information,
suchUML
as exceptions
or events,
though
of the typical
even additional
though you
may not write
diagrams yourself,
you'll
still this
needistooutside
interpret
notation.
diagrams written by others.
UML
that the from
class O'Reilly
name: feels your pain. It's been crafted for professionals like
UML suggests
2.0 in a Nutshell
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
Start with a capital letter

This Be
comprehensive
newtop
edition
not only provides a quick-reference to all UML 2.0 diagram
centered in the
compartment
types, it also explains key concepts in a way that appeals to readers already familiar with
UML Be
or object-oriented
programming
concepts.
written in a boldface
font
Topics
Beinclude:
written in italics if the class is abstract (see "Abstract Classes")
Figure 2-1 shows a simple class.
The role and value of UML in projects

The object-oriented paradigm and its relation to the UML

Figure 2-1. Simple class representation

An integrated approach to UML diagrams

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

2.1.1. Objects

An object is an instance of a class. For example, you may have several instances of a class
namedCar: one two-door red car, one four-door blue car, and one hatchback green car. Each

www.it-ebooks.info

instance of Car is an object and may be given its own name, though it is common to see
unnamed, or anonymous, objects on object diagrams. Typically you show the name of the
object followed by a colon followed by its type (i.e., class). You show that this is an instance
UML 2.0 in athe
Nutshell
of a class by underlining
name and type. Figure 2-2 shows an instance of a class Car
ByDanthat
Pilone,
Pitman
namedToyota. Note
inNeil
this
figure, we have hidden the empty compartments.
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Figure 2-2. An
Pages:234

instance of Car

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
2.2. Attributes
...............................................
Publisher:O'Reilly
Pub
Date:
June
Details of a class
(the
color
of2005
a car, the number of sides in a shape, etc.) are represented as
ISBN:0-596-00795-7
attributes . Attributes
can be simple primitive types (integers, floating-point numbers, etc.) or
relationships to Pages:
other,234
complex objects (see "Relationships").

An attribute can be shown using two different notations: inlined or relationships between
Table of Contents
| Index
classes.
In addition,
notation is available to show such things as multiplicity, uniqueness, and
ordering. This section introduces both notations, and then describes the details of the
attribute specification.
System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages.
UML makes
it possible for team members to collaborate by providing a common
2.2.1.
Inlined
Attributes
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
You can list a class's attributes right in rectangle notation; these are typically called inlined
Today, UML has become the standard method for modeling software systems, which means
attributes . There is no semantic difference between inlined attributes and attributes by
you're probably confronting this rich and expressive language more than ever before. And
relationship; it's simply a matter of how much detail you want to present (or, in the case of
even though you may not write UML diagrams yourself, you'll still need to interpret
primitives like integers, how much detail you can present).
diagrams written by others.
To represent an attribute within the body of a class, place the attribute in the second
UML 2.0 in a Nutshell
fromUML
O'Reilly
feels
your pain.
It's been
crafted for
professionals
compartment
of the class.
refers
to inlined
attributes
as attribute
notation
. Inlinedlike
you who must
read,
create,notation:
and understand system artifacts expressed using UML.
attributes
use the
following
Furthermore, it's been fully revised to cover version 2.0 of the language.
visibility
/ name new
: type
multiplicity
= default
This comprehensive
edition
not only provides
a quick-reference to all UML 2.0 diagram
{property
constraints
} that appeals to readers already familiar with
types,
it also strings
explains and
key concepts
in a way
UML or object-oriented programming concepts.
visibility ::= {+|-|#|~}
Topics include:
multiplicity ::= [lower ..upper ]

The role and value of UML in projects


paradigm
and its relation
to theaspects
UML of attribute notation.
FigureThe
2-3 object-oriented
lists several attributes,
demonstrating
various
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
Figure 2-3. Example attributes
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

The syntax elements are:

www.it-ebooks.info

visibility

Indicates the visibility of the attribute. Use the following symbols: +, -, #, or ~ for
UML 2.0
in a Nutshell
public,private
,protected
, or package, respectively (see "Visibility" in Chapter 3).
ByDan Pilone,Neil Pitman

...............................................
Publisher:O'Reilly
Pub Date: June 2005
Indicates ISBN:
the attribute
is derived . A derived attribute is simply one that can be
0-596-00795-7
computedPages:
from 234
other attributes of the class. See "Derived Attributes."

name
Table of Contents

| Index

Is a noun or short phrase naming the attribute. Typically the first letter is lowercase,
anddevelopers
the first letter
eachmodeling
subsequent
word isfor
capitalized.
System
haveofused
languages
decades to specify, visualize,

construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
type
language that applies to a multitude of different systems. Essentially, it enables you to
communicate
solutions
in a consistent,
tool-supported
language.
Is the type
of the attribute
as another
classifier, typically
a class, interface, or built-in
type like int .
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
multiplicity
diagrams written by others.
Specifies how many instances of the attribute's type are referenced by this attribute.
UML 2.0
a Nutshell
from O'Reilly
feels your
pain.
It's been
crafted
professionals
Caninbe
absent (meaning
multiplicity
of 1),
a single
integer,
or afor
range
of values like
you who
must between
read, create,
andbrackets
understand
systembyartifacts
expressed
using UML. to
specified
square
separated
"..". Use
* as the upperbound
Furthermore,
been
fully
revised
to cover
version
2.0zero
of the
representit's
the
upper
limit
or * on
its own
to mean
or language.
more. See "Multiplicity."

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
default
types, it also explains key concepts in a way that appeals to readers already familiar with

UML or object-oriented programming concepts.


Is the default value of the attribute.
Topics include:
property strings

The role and value of UML in projects


Is a collection of properties, or tags, that can be attached to attributes. These are
The object-oriented
paradigm
and itssuch
relation
to the
UML
typically
context-specific
and denote
things
as ordering
or uniqueness. They are
surrounded by {} and separated by commas. See "Properties."
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
constraints
and Deployment Diagrams
Are one or more restrictions placed on an attribute. They may be natural language or
Extension
Mechanisms
use
a formal
grammar such as the OCL. See "Constraints."
The Object Constraint Language (OCL)

2.2.2. Attributes by Relationship


If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly
yourself
with the
system.
You
mayfamiliarize
also represent
attributes
using
the relationship notation. The relationship notation
results in a larger class diagram, but it can provide greater detail for complex attribute types.
The relationship notation also conveys exactly how the attribute is contained within a class
(see "Relationships" for information on the types of relationships). For example, if you are
modeling a Car, you can show that a car contains an Engine much more clearly using
relationships than you can just by listing an attribute in the Car's rectangle. However, showing

www.it-ebooks.info

theCar's name by relationship is probably overkill because it is likely just a string.


To represent an attribute using relationships you use one of the association relationships
UMLcontaining
2.0 in a Nutshell
between the class
the attribute and the class that represents the attribute, as
shown in FigureBy
2-4,
whichNeil
shows
Dan Pilone,
Pitmanthat the relationship between a car and its engine has a
multiplicity of 1;...............................................
a car has one engine.
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
Figure
2-4. Attribute

using relationship notation

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's
been
revised
cover version
2.0 cars
of the
language.
Yes,
yes,fully
as my
editortopointed
out, some
like
the Toyota Prius have
two engines. Work with me here.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

Topics include:
Relationship
notation supports the same syntax as inlined notation, though the layout is
slightly different. The attribute's visibility and name are placed near the relationship line.
Don't use square brackets for multiplicity, but do place the multiplicity specification near the
The role and value of UML in projects
attribute's classifier.
The object-oriented paradigm and its relation to the UML
Like multiplicity, you can place constraints on attributes (see "Constraints"). In relationship
notation,
you write constraints
attribute's classifier along the relationship line. UML
An integrated
approach tonear
UMLthe
diagrams
allows relationship notation to also express constraints between attributes, as shown in Figure
2-5. Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms

Figure 2-5. Relationship notation using constraints


The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

InFigure 2-5, the standard UML constraint xor shows that only automaticTransmission or
manualTransmission can be set at any given time (exclusive or). You need to express this
constraint
in a note ifhave
the used
inlined
attributelanguages
notation was
used. to specify, visualize,
System developers
modeling
for decades
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language
that applies
to a multitude of different systems. Essentially, it enables you to
2.2.3.
Derived
Attributes
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
The derived notation, which is the leading forward slash (/), can be used as an indicator to
you're probably confronting this rich and expressive language more than ever before. And
the implementer that the attribute may not be strictly necessary. For example, let's say you
even though you may not write UML diagrams yourself, you'll still need to interpret
modeled a bank account with a simple class named Account. This class stores the current
diagrams written by others.
balance as a floating-point number named balance. To keep track of whether this account is
overdrawn, you add a boolean named overdrawn. Whether the account is overdrawn is really
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
based on whether the balance is positive, not the boolean you added. You can indicate this to
you who must read, create, and understand system artifacts expressed using UML.
the developer by showing that overdrawn is a derived attribute, with its state based on
Furthermore, it's been fully revised to cover version 2.0 of the language.
balance.Figure 2-6 shows how balance and overdrawn can be represented using a note to
convey the relationship.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:

Figure 2-6. Derived attribute

The role and value of UML in projects


The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension
Mechanisms
The UML
specification
notes that a derived attribute is typically readOnly, meaning a user may
not modify the value. However, if a user is permitted to modify the value, the class is
The Object Constraint Language (OCL)
expected to update the source of the derived information appropriately.

If you're
new to UML,
a tutorial with realistic examples has even been included to help you
2.2.4.
Attribute
Multiplicity
quickly familiarize yourself with the system.

The multiplicity of an attribute specifies how many instances of the attribute's type are
created when the owning class is instantiated. For example, our Car class will likely have four
wheels, so the multiplicity of the wheel attribute is 4. If no multiplicity is specified, 1 is
implied. Multiplicity can be a single integer, a list of integers separated by commas, or a
range of values. When specifying a range of values, an infinite upper bound can be

www.it-ebooks.info

represented as an *; if no lower bound is specified, an * means zero or more. The multiplicity


value is shown between square brackets as a single integer or as two integers separated by
two dots (..).Figure 2-7 shows the various ways to represent an attribute's multiplicity.
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Figure 2-7. Multiplicity
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

examples

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
2.2.4.1.
Ordering
communicate
solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
An
attribute
with confronting
a multiplicity
greater
than
1 can be language
specified to
be ordered
. If before.
the attribute
you're
probably
this
rich and
expressive
more
than ever
And
iseven
ordered,
theyou
elements
must
beUML
stored
sequentially.
Foryou'll
example,
you can
specify that a list
though
may not
write
diagrams
yourself,
still need
to interpret
of
names be
storedbyalphabetically
by marking the list as ordered. Exactly what it means for
diagrams
written
others.
attributes to be stored sequentially typically depends on the attribute type. By default,
attributes
not ordered.
mark feels
an attribute
as ordered,
ordered
UML 2.0 inare
a Nutshell
fromTo
O'Reilly
your pain.
It's beenspecify
craftedthe
forproperty
professionals
likeafter
the
in read,
braces,
as shown
in Figure 2-8.
youattribute
who must
create,
and understand
system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
Ordered
multiplicity
types, it also explains keyFigure
concepts2-8.
in a way
that appeals
to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and
Deployment Diagrams
2.2.4.2.
Uniqueness
Extension Mechanisms
In addition to being ordered, an attribute with multiplicity greater than 1 may be required to
beunique
If an attribute
is required
to (OCL)
be unique, each element of this attribute must be
The. Object
Constraint
Language
unique. By default, attributes with multiplicity greater than 1 are unique , meaning there can
be no duplicates in the elements this attribute holds. For example, if a class held a list of
voters and each person was allowed to vote only once, each element in the list would be
unique.
Tonew
make
an attribute
unique,
place the
keywordhas
unique
the
attribute
braces,
If you're
to UML,
a tutorial
with realistic
examples
evenafter
been
included
to in
help
you
as
shownfamiliarize
in Figure yourself
2-9. To allow
an attribute
quickly
with the
system. to hold duplicates of an object, simply use the
propertynotunique.

Figure 2-9. Unique multiplicity

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

2.2.4.3. Collection types


Table of Contents | Index

The UML specification specifies a set of mappings from the various ordered and uniqueness
System developers
have used
modeling
languages
for mappings
decades tofrom
specify,
visualize,
properties
to UML collection
types.
Table 2-1
shows the
attribute
properties to
construct,
and document
systems.
Thecollection
Unified Modeling
Language
(UML)
is one
of mappings
those
the
UML collection
type. Note
that the
types shown
in Table
2-1 are
UML
languages.
it to
possible
members
to collaborate by providing a common
and
may notUML
mapmakes
directly
classesfor
inteam
a target
language.
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting
this rich
and expressive
language
more than ever before. And
Table 2-1.
Collection
types
for attributes
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
Order Uniqueness Associated collection type
UML 2.0False
in a Nutshell Bag
from O'Reilly feels your pain. It's been crafted for professionals like
False
you who must read, create, and understand system artifacts expressed using UML.
True
True
OrderedSet
Furthermore, it's been fully revised to cover version 2.0 of the language.
False True
Set
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
True
False
Sequence
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
For
example,
to show that a bank's clients should be represented using an OrderedSet, you
Topics
include:
can model the clients attribute as shown in Figure 2-10.

The role and value of UML in projects


TheFigure
object-oriented
andattribute
its relation to
the UML
2-10. paradigm
Example
stored
in

an OrderedSet

An integrated approach to UML diagrams


Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you

2.2.5.
Properties
quickly Attribute
familiarize yourself
with the system.

In addition to the properties associated with multiplicity, an attribute may have a number of
properties set to convey additional information to the reader of the diagram. The common
properties defined by UML are:

www.it-ebooks.info

readOnly
UML 2.0 in a Nutshell

Specifies that
attribute
may not be modified once the initial value is set. This
ByDanthe
Pilone,
Neil Pitman
typically maps
to a constant in a development language. UML doesn't specify when the
...............................................
initial value
must be
set, though if you specify the default value for an attribute it is
Publisher:
O'Reilly
considered
the
initial
value
Pub
Date:
June
2005and may not be changed.
ISBN:0-596-00795-7
Pages:234

union
Specifies
that
Table of Contents
| Index

the attribute type is a union of the possible values for this attribute.
Frequently this is used with the derived property to indicate that an attribute is a
derived union of another set of attributes.

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
subsets <attribute-name>
languages. UML makes it possible for team members to collaborate by providing a common
language
that applies
a multitude
enables
you to
Specifies
that thistoattribute
typeofisdifferent
a subsetsystems.
of all theEssentially,
valid valuesitfor
the given
communicate
solutions
in
a
consistent,
tool-supported
language.
attribute. This isn't a common property, but if used, it is typically associated with
subclasses of an attribute type.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though
you may not write UML diagrams yourself, you'll still need to interpret
redefines
<attribute-name>
diagrams written by others.
Specifies that this attribute acts as an alias for the given attribute. Though uncommon,
UML 2.0
a Nutshell
O'Reilly
feelsthat
youra pain.
It's been
crafted
for professionals
thisinattribute
canfrom
be used
to show
subclass
has an
attribute
that is an aliaslike
for a
you who
must read,
create, and understand system artifacts expressed using UML.
superclass's
attribute.
Furthermore, it's been fully revised to cover version 2.0 of the language.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
composite
types, it also explains key concepts in a way that appeals to readers already familiar with
Specifies
that this programming
attribute is part
of a whole-part relationship with the classifier. See
UML or
object-oriented
concepts.
"Relationships" for more information on composition.
Topics include:

2.2.6.The
Constraints
role and value of UML in projects
The object-oriented paradigm and its relation to the UML
Constraints represent restrictions placed on an element. They may be natural language or use
a formal
as theto
OCL;
An grammar
integratedsuch
approach
UMLhowever,
diagramsthey must evaluate to a boolean expression.
You typically show constraints between curly braces ({}) after the element they restrict,
Usein
Case,
Sequence,
Collaboration,
Statechart,
Activity,line.
Component,
thoughClass
theyand
mayObject,
be placed
a note
and linked
to the element
using a dashed
and Deployment Diagrams
You can name a constraint by specifying the name followed by a colon (:) before the boolean
Extension
expression.
This Mechanisms
is frequently used to identify constraints on an operation (see "Operation
Constraints").
The Object Constraint Language (OCL)
Figure 2-11 shows several constraints on attributes and operations.
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize
the system.
Figureyourself
2-11. with
Examples
of inlined and note constraints

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
2.2.7.
Static Attributes
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Static attributes are attributes of the class rather than of an instance of the class. For
example,
youhas
canbecome
initializethe
constant
values
for afor
class
and share
themsystems,
between which
all instances
Today, UML
standard
method
modeling
software
means
of
the class.
You confronting
represent static
attributes
by underlining
theirmore
specification
in before.
both inlined
you're
probably
this rich
and expressive
language
than ever
And
and
relationship-based
presentations,
as shownyourself,
in Figureyou'll
2-12.still need to interpret
even
though you may not
write UML diagrams
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
2-12. system
Staticartifacts
attribute
you who must read, create,Figure
and understand
expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
2.3. Operations
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Operations are features
of classes that specify how to invoke a particular behavior. For
example, a classPages:
may234
offer an operation to draw a rectangle on the screen or count the

number of items selected in a list. UML makes a clear distinction between the specification of
how to invoke a behavior (an operation) and the actual implementation of that behavior (a
Table of Contents
method).
See| Index
"Methods" for more information.
You place operations in a separate compartment with the following syntax:
System developers have used modeling languages for decades to specify, visualize,
construct, and
document
systems.
Unified Modeling
Language (UML) is one of those
visibility
name
( parameters
) :The
return-type
{properties}
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
where parameters are written as:
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
direction parameter_name : type [ multiplicity ]
even though you may not write UML diagrams yourself, you'll still need to interpret
= default_value
properties }
diagrams
written by{others.

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who
must
read,
create,
and understand
system
artifacts expressed using UML.
Figure
2-13
shows
several
example
operations
on a class.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
Figure 2-13. Example operations on a class
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
The syntax elements are:
Extension Mechanisms
The Object Constraint Language (OCL)
visibility

Indicates the visibility of the operation. Use the following symbols: +, -, #, or ~ for
If you're
new
to UML,
a tutorial, with
realistic
examples has
even
been included
to help
public
,private
,protected
or package
, respectively
(see
"Visibility"
in Chapter
3). you
quickly familiarize yourself with the system.
name

Is a short phrase naming the operation. Operations are usually verb phrases
representing actions the classifier should perform on behalf of the caller. The UML

www.it-ebooks.info

specification recommends that the first letter of an operation be lowercase, with all of
the following words starting with a capital letter and running together. See Figure 2-13
for an example.
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman

return-type

...............................................
Publisher:O'Reilly
Is the type
ofDate:
information
the operation will return, if any. If no information is returned
Pub
June 2005
from the operation
(called a subroutine in some development languages), the return
ISBN:0-596-00795-7
Pages:
234 . If the operation does return a value (called a function in some
type should
be void

development languages), you should show the type of the returned value, such as
another classifier, a primitive type, or a collection. The UML specification states that the
Table of Contents
| Indexis optional. If it's left off, you can't assume anything about the return value
return type
of the operation, or even if one exists.

System developers have used modeling languages for decades to specify, visualize,
properties
construct, and document systems. The Unified Modeling Language (UML) is one of those

languages. UML makes it possible for team members to collaborate by providing a common
Specifies
constraints
properties
associated
with an
operation.it These
areyou
optional;
if
language
that applies
to a and
multitude
of different
systems.
Essentially,
enables
to
you
don't
use
properties
you
don't
show
the
curly
braces.
See
"Operation
Constraints"
communicate solutions in a consistent, tool-supported language.
for more information.
Today, UML has become the standard method for modeling software systems, which means
Parameter syntax elements are:
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
direction

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who
must read,
understand
system
artifacts
expressed
using
An optional
partcreate,
of the and
syntax
that indicates
how
a parameter
is used
by UML.
an operation.
Furthermore,
it's
been
fully
revised
to
cover
version
2.0
of
the
language.
It is one of in,inout,out, or return.in states that the parameter is passed to the
operation by the caller. inout states that the parameter is passed by the caller and is
This comprehensive
new edition
notoperation
only provides
a quick-reference
to all
UMLthat
2.0 the
diagram
then possibly modified
by the
and passed
back out. out
states
types,parameter
it also explains
keybyconcepts
in but
a way
that appeals
to operation
readers already
with
isn't set
the caller
is modified
by the
and is familiar
passed back
UML or
object-oriented
programming
concepts.
out.
return indicates
that the value
set by the caller is passed back out as a return
value.
Topics include:
parameter_name

The role and value of UML in projects


Is a noun or noun phrase naming the parameter. Typically the parameter name starts
The object-oriented
paradigm
andsubsequent
its relation words
to the starting
UML
with
a lowercase letter,
with any
with a capital letter.
An integrated approach to UML diagrams
type

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and
Deployment
Is
the
type of theDiagrams
parameter. This is typically another class, interface, collection, or
primitive type.
Extension Mechanisms

The Object Constraint Language (OCL)


multiplicity
Specifies how many instances of the parameter's type are present. Can be absent
(meaning multiplicity of 1), a single integer, a list of integers separated by commas, or
If you're new to UML, a tutorial with realistic examples has even been included to help you
a range of values specified between square brackets separated by "..". An infinite upper
quickly familiarize yourself with the system.
bound can be represented as an *; if no lower bound specified, an * means zero or
more. See "Multiplicity."

default_value

www.it-ebooks.info

Specifies the default value of this parameter. The default value is optional. If it isn't
present, you don't show the equals sign. Note that UML doesn't specify if a parameter
with a default value may be left out when invoking an operation (e.g., C++'s default
2.0 in
a Nutshell
parameterUML
value
implementation).
The actual syntax for invoking an operation is
ByDan Pilone,Neil Pitman
language-dependent.
...............................................
Publisher:O'Reilly
properties
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:
234
Specifies any
parameter-related
properties and is specified between curly braces. These

are typically defined within the context of a specific model, with a few exceptions:
ordered,readOnly, and unique. See "Multiplicity" and "Properties" for more information.
Table of Contents
| Index
Properties
are optional for parameters; if they aren't used, don't show the curly braces.

SystemOperation
developers have
used modeling languages for decades to specify, visualize,
2.3.1.
Constraints

construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
An operation may have several constraints associated with it that help define how the
communicate solutions in a consistent, tool-supported language.
operation interacts with the rest of the system. Together, constraints on an operation
establish a contract that an implementation of the operation must obey.
Today, UML has become the standard method for modeling software systems, which means
you're probably
this rich
expressive
language
thanplaced
ever before.
Constraints
on anconfronting
operation follow
theand
usual
constraint
notationmore
and are
either And
even
though
you
may
not
write
UML
diagrams
yourself,
you'll
still
need
to
interpret
immediately after the operation signature or in a note attached with a dashed line. See
diagrams written
by others.
"Constraints"
for more
information.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
2.3.1.1.
Preconditions
Furthermore, it's been fully revised to cover version 2.0 of the language.
Preconditions
capturenew
what
the state
theprovides
system amust
be before antooperation
candiagram
be
This comprehensive
edition
not of
only
quick-reference
all UML 2.0
invoked.
Practically
speaking,
you
really
can't
express
the
state
of
the
entire
system.
types, it also explains key concepts in a way that appeals to readers already familiar Instead,
with
preconditions
typically express
the valid
values for parameters, the state of the class owning
UML or object-oriented
programming
concepts.
the operation, or a few key attributes of the system.
Topics include:
The specification explicitly states that the operation doesn't need to check the preconditions in
the body of the operation before executing; theoretically the operation will not even be
invoked
if the
aren't
In practice, few languages offer such protection. If
The
role preconditions
and value of UML
in met.
projects
someone took the time to express them, it is usually in your best interest to verify the
The object-oriented
paradigm
and its relation
to the UML
preconditions
are correct when
implementing
an operation.

An integrated
approach offer
to UML
diagrams
As a developer,
preconditions
you
one of the few chances to "cover your butt" and say
exactly how you expect things to be when your implementation is invoked; use them.
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
Deployment
Diagrams
Figureand
2-14
shows several
examples of preconditions.
Extension Mechanisms
The Object Constraint
Language
(OCL)
Figure 2-14.
Preconditions

for operations

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

2.3.1.2. Postconditions
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman

Postconditions capture
guarantees about the state of the system after an operation has
...............................................
executed. Like preconditions,
postconditions typically express the state of one or more key
Publisher:O'Reilly
attributes of thePub
system,
or some
Date: June
2005guarantee about the state of the class owning the
ISBN:0-596-00795-7
operation.
Pages:234

Figure 2-15 shows example postconditions linked to an operation.


Table of Contents | Index

Figure 2-15. Postconditions for operations


System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
2.3.1.3.
Body conditions
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

An operation may have a bodyCondition that constrains the return value. The bodyCondition
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
is separate from the postcondition because the bodyCondition may be replaced by methods of
types, it also explains key concepts in a way that appeals to readers already familiar with
subclasses of the owning class. (See "Generalization" for more information on subclasses.) For
UML or object-oriented programming concepts.
example, a class named Window may specify a body condition for a method named getSize( )
that requires the length and width of a window be nonzero. A subclass named SquareWindow
Topics include:
may provide its own body condition stating that the width must equal the height. The
bodyCondition is similar to the pre- and postconditions in that the constraint may be
expressed
in natural
language
orin
inprojects
OCL. See "Constraints" for more information. Figure 2-16
The role
and value
of UML
shows an example of a bodyCondition on an operation.
The object-oriented paradigm and its relation to the UML

An integrated approach to UML diagrams

Figure 2-16. Body conditions for operations

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

2.3.1.4. Query operations


An operation may
as a query operation if the implementation of the operation
UMLbe
2.0declared
in a Nutshell
doesn't modify the
owning
class
in any way. In practice, modelers often use the query
ByDan Pilone,Neil Pitman
property to indicate a method that doesn't change any meaningful attribute of an object. For
...............................................
example, there Publisher:
may be internal
cache attributes that are updated as a result of a query. The
O'Reilly
important thing Pub
is that
the
state
of the system, from an external perspective, isn't changed by
Date:
June
2005
the query method;
there
can
be
no
ISBN:0-596-00795-7 side effects to calling the method.
Pages:234

You indicate a query method by placing the query constraint after the operation signature. For
example, an operation named getAge( ) that simply returns an integer without changing any
internal
value| Index
of the owning class would be considered a query method. In C++, this typically
Table of Contents
maps to a const method. Figure 2-17 shows several query methods on a class.

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
Figure
2-17.
query
operations
languages. UML makes
it possible
for Example
team members
to collaborate
by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

2.3.1.5. Exceptions

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or
object-oriented
concepts.
While
they're
technically programming
not constraints,
you may express exceptions thrown by an operation
using similar notation. Exceptions are typically other classes (often stereotyped with the
Topics include:
keyword
exception, though this is simply by convention) that are thrown by an operation in
the event of an error. You can list thrown exceptions in a note attached to an operation using
a dashed line. Figure 2-18 shows an example of an operation that throws several exceptions.
The role and value of UML in projects

The object-oriented paradigm and its relation to the UML

Figure 2-18.
A to
method
that
An integrated
approach
UML diagrams

throws several exceptions

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

2.3.2. Static Operations


Operations typically
specify
behavior for an instance of a class. However, UML allows for an
UML 2.0
in a Nutshell
operation to specify
behavior
for the class itself . These operations are called static operations
ByDan Pilone,Neil Pitman
and are invoked...............................................
directly on the class, not on an instance. Static operations are frequently
used as utility operations
that don't need to use the attributes of the owning class. UML
Publisher:O'Reilly
doesn't formallyPub
discuss
of these operations, but it is typical to see them
Date: the
Junenotation
2005
represented with
the0-596-00795-7
same convention as static attributes. You indicate an operation is static
ISBN:
by underlining the
operation
signature. Figure 2-19 shows an example of a static operation.
Pages:
234

Table of Contents | Index

Figure 2-19. A class with a static operation


System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
2.4. Methods
...............................................
Publisher:O'Reilly
Pub Date: June 2005
Amethod is an implementation
of an operation. Each class typically provides an
0-596-00795-7
implementation ISBN:
for its
operations or inherits them from its superclass (see "Generalization").
Pages:
234 an implementation for an operation, and one isn't provided by its
If a class doesn't
provide
superclass, the operation is considered abstract . See "Abstract Classes" for more information.
Because methods are implementations of operations, there is no notation for a method;
Table of Contents
| Index
simply
show an
operation on a class.

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
2.5. Abstract
Classes
...............................................
Publisher:O'Reilly
Pub Date: June 2005
0-596-00795-7
Anabstract classISBN:
is typically
a class that provides an operation signature, but no
234 you can have an abstract class that has no operations at all. An
implementation;Pages:
however,

abstract class is useful for identifying common functionality across several types of objects.
For example, you can have an abstract class named Movable. A Movable object has a current
Table of Contents
| Index
position
and the
ability to move somewhere else using an operation named move( ). There
can be several specializations of this abstract classa Car, a Grasshopper, and a Person, each of
which provides a different implementation of move( ). Because the base class Movable doesn't
have
an implementation
move(
), the languages
class is said
todecades
be abstract.
System
developers havefor
used
modeling
for
to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
You
show a class
is abstract
by writing
its name
in italics.
Show eachby
abstract
operation
in
languages.
UML makes
it possible
for team
members
to collaborate
providing
a common
italics
as well.
an example
of the abstract
class
Movable. it enables you to
language
that Figure
applies2-20
to a ismultitude
of different
systems.
Essentially,
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
2-20.
Abstract
class
you're probably confronting Figure
this rich and
expressive
language
more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
An
abstract
class can't be instantiated; it must be subclassed and then a subclass which does
Topics
include:
provide the operation implementation can be instantiated. See "Relationships" for more
information on subclasses.
The role and value of UML in projects

The object-oriented paradigm and its relation to the UML


An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
2.6. Relationships
...............................................
Publisher:O'Reilly
Pub Date:
Classes in isolation
wouldJune
not 2005
provide much insight into how a system is designed. UML
0-596-00795-7
provides severalISBN:
ways
of representing relationships between classes. Each of UML relationship
Pages:234
represents a different
type of connection between classes and has subtleties that aren't fully
captured in the UML specification. When modeling in the real world, be sure that your
intended viewers understand what you are conveying with your various relationships. We say
Table of
Contents
this
both
as a| Index
warning to the modeler and as a slight disclaimer that the following
explanations are our interpretation of the UML specification. For example, the debate over
when to use aggregation versus composition is ongoing. To help determine which relationship
developers have
useda modeling
languages
decades
to specify,
visualize,
isSystem
most appropriate,
we offer
short phrase
for eachfor
type
that may
help make
the distinction.
construct,
and document
The Unified
Modeling
(UML) is one of those
Again,
the important
thingsystems.
is to be consistent
within
your Language
model.
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

2.6.1. Dependency

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
The
weakest
classes
is a dependency
relationship.
even
thoughrelationship
you may notbetween
write UML
diagrams
yourself, you'll
still need Dependency
to interpret between
classes
means
that
one
class
uses,
or
has
knowledge
of,
another
class.
It
is typically a
diagrams written by others.
transient relationship, meaning a dependent class briefly interacts with the target class but
typically
retain from
a relationship
withyour
it forpain.
any real
lengthcrafted
of time.
UML 2.0 doesn't
in a Nutshell
O'Reilly feels
It's been
for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Dependencies are typically read as "...uses a...". For example, if you have a class named
Furthermore, it's been fully revised to cover version 2.0 of the language.
Window that sends out a class named WindowClosingEvent when it is about to be closed, you
would say "Window uses a WindowClosingEvent."
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types,
it also
explains key
concepts
in a way
that
appealsline
to readers
already
familiarfrom
withthe
You
show
a dependency
between
classes
using
a dashed
with an arrow
pointing
UML
or
object-oriented
programming
concepts.
dependent class to the class that is used. Figure 2-21 shows a dependency between a class
namedWindow and a class named WindowClosingEvent.
Topics include:

The role and value of UML in projects

Figure 2-21. Window's dependency on WindowClosingEvent

The object-oriented paradigm and its relation to the UML


An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)
You can likely assume from Figure 2-21 that Window doesn't retain a relationship with a
WindowClosingEvent
foraany
real length
of time.
It simplyhas
uses
them
when
needed
If you're new to UML,
tutorial
with realistic
examples
even
been
included
to and
helpthen
you
forgets
about
them.
quickly familiarize yourself with the system.

2.6.2. Association
Associations are stronger than dependencies and typically indicate that one class retains a

www.it-ebooks.info

relationship to another class over an extended period of time. The lifelines of two objects
linked by associations are probably not tied together (meaning one can be destroyed without
necessarily destroying the other).
UML 2.0 in a Nutshell

Associations areBytypically
as "...has a...". For example, if you have a class named Window
Dan Pilone,read
Neil Pitman
that has a reference
to the current mouse cursor, you would say "Window has a Cursor". Note
...............................................
that there is a fine
line between
Publisher:
O'Reilly "...has a..." and "...owns a..." (see "Aggregation" later in this
Date:
June 2005
section). In thisPub
case,
Window
doesn't own the Cursor;Cursor is shared between all
ISBN:
0-596-00795-7
applications in the
system.
However, Window has a reference to it so that the Window can hide
Pages:etc.
234 You show an association using a solid line between the classes
it, change its shape,
participating in the relationship. Figure 2-22 shows an association between Window and Cursor.
Table of Contents | Index

Figure 2-22. Association showing Window "has a" Cursor


System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like

2.6.2.1.
you whoNavigability
must read, create, and understand system artifacts expressed using UML.

Furthermore, it's been fully revised to cover version 2.0 of the language.
Associations have explicit notation to express navigability. If you can navigate from one class
to
another,
you shownew
an arrow
in not
the only
direction
of the
class you can navigate
to. 2.0
If you
can
This
comprehensive
edition
provides
a quick-reference
to all UML
diagram
navigate
both
directions,
it is common
practice
not show
any arrows
at all,
but aswith
the
types, it in
also
explains
key concepts
in a way
that to
appeals
to readers
already
familiar
UML
points programming
out, if you suppress
all arrows you can't distinguish nonnavigable
UMLspecification
or object-oriented
concepts.
associations from two-way associations. However, it is extremely rare to use a nonnavigable
association
in the real world, so this is unlikely to be a problem.
Topics include:
You can explicitly forbid navigation from one class to another by placing a small X on the
The role
value
projects
association
lineand
at the
endofofUML
the in
class
you can't navigate to. Figure 2-23 shows an association
between a class named Window and a class named Cursor. Because you can't navigate from an
Theofobject-oriented
paradigm
and its, relation
to theshow
UMLthe navigability arrow and an X
instance
Cursor to an instance
of Window
we explicitly
where appropriate.
An integrated approach to UML diagrams

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams

Figure 2-23. Association between Window and Cursor showing you


can't navigate from Cursor to Window
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

2.6.2.2. Naming an association


UML 2.0 in a Nutshell

Associations may be adorned with several symbols to add information to your model. The
ByDan Pilone,Neil Pitman
simplest is a solid
arrowhead showing the direction in which the viewer should read the
association. It is...............................................
common to include a short phrase along with the arrowhead to provide some
Publisher:O'Reilly
context for the association.
The phrase used with the association doesn't typically generate
Pub Date: June 2005
into any form of code representation; it is purely for modeling purposes. Figure 2-24 shows
ISBN:0-596-00795-7
the solid arrowhead on the Window to Cursor association.
Pages:234

Table of Contents | Index

Figure 2-24. Shows how to read the association between Window


and Cursor

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 Multiplicity
in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
2.6.2.3.

you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
Because associations typically represent lasting relationships, they are often used to indicate
attributes of a class. As mentioned in the "Attributes by Relationship" section, you can
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
express how many instances of a particular class are involved in a relationship. If you don't
types, it also explains key concepts in a way that appeals to readers already familiar with
specify a value, a multiplicity of 1 is assumed. To show a different value, simply place the
UML or object-oriented programming concepts.
multiplicity specification near the owned class. See "Attribute Multiplicity" for the allowable
multiplicity types. Note that when you use multiplicity with an association, you don't use
Topics include:
square brackets around the values. Figure 2-25 shows an association with explicit multiplicity.
The role and value of UML in projects

Figure
A simple
association
showing
four Buttons in a Window
The 2-25.
object-oriented
paradigm
and its relation
to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

The
properties
related
multiplicity
be applied
to associations
as included
well. Seeto
"Properties"
If you're
new to
UML, to
a tutorial
with may
realistic
examples
has even been
help you
for
the names
and definitions
of allowed
properties.
quickly
familiarize
yourself with
the system.

2.6.3. Aggregation

www.it-ebooks.info

Aggregation is a stronger version of association. Unlike association, aggregation typically


implies ownership and may imply a relationship between lifelines. Aggregations are usually
read as "...owns a...". For example, if you had a classed named Window that stored its position
UML 2.0 inclass,
a Nutshell
and size in a Rectangle
you would say the "Window owns a Rectangle." The rectangle
ByDanother
Pilone,Neil
Pitmanbut the Window has an intimate relationship with the
may be shared with
classes,
Rectangle. This ...............................................
is subtly different from a basic association; it has a stronger connotation.
Publisher:
O'Reilly relationship you can have between classes. If the relationship
However, it's not
the strongest
Pub part
Date:(class
June 2005
is more of a whole
A "...is part of..." class B), you should look at composition .
ISBN:0-596-00795-7
Pages:234 with a diamond shape next to the owning class and a solid line
You show an aggregation
pointing to the owned class. Figure 2-26 shows an example aggregation between a class
namedWindow and a class named Rectangle.
Table of Contents | Index

System developersFigure
have used
modeling
languages
for decades
to specify, visualize,
2-26.
Window
"owns
a" Rectangle
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you
who
must
read, create,
and understand
system
artifacts expressed
using UML.
As
with
the
association
relationship,
you can show
navigability
and multiplicity
on an
Furthermore,
it's
been
fully
revised
to
cover
version
2.0
of
the
language.
aggregation line. See "Association" for examples.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
2.6.4.
Composition
UML or object-oriented programming concepts.
Composition
represents a very strong relationship between classes, to the point of
Topics include:
containment. Composition is used to capture a whole-part relationship. The "part" piece of the
relationship can be involved in only one composition relationship at any given time. The
The
and value
of UML
in projects relationships is almost always linked; if the
lifetime
of role
instances
involved
in composition
larger, owning instance is destroyed, it almost always destroys the part piece. UML does allow
The
paradigm
and its
relation
to the
UML
the part
toobject-oriented
be associated with
a different
owner
before
destruction,
thus preserving its
existence, but this is typically an exception rather than the rule.
An integrated approach to UML diagrams
A composition relationship is usually read as "...is part of...", which means you need to read
Class and Object,
Case,
Sequence,
Collaboration,
Statechart,
Component,
the composition
from theUse
part
to the
whole. For
example, if you
say thatActivity,
a window
in your
and
Deployment
Diagrams
system
must
have a titlebar,
you can represent this with a class named Titlebar that "...is
part of..." a class named Window.
Extension Mechanisms
You show a composition relationship using a filled diamond next to the owning class and a
The Object Constraint Language (OCL)
solid line pointing to the owned class. Figure 2-27 shows an example composition relationship
between a class named Window and a class named Titlebar.

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

Figure 2-27. Titlebar "is a part of" Window

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

As with the association relationship, you can show navigability and multiplicity on a
composition line. See "Association" for examples.
Table of Contents | Index

2.6.5.
Generalization
System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
Ageneralization relationship conveys that the target of the relationship is a general, or less
language that applies to a multitude of different systems. Essentially, it enables you to
specific, version of the source class or interface. Generalization relationships are often used to
communicate solutions in a consistent, tool-supported language.
pull out commonality between difference classifiers. For example, if you had a class named
Cat and a class named Dog, you can create a generalization of both of those classes called
Today, UML has become the standard method for modeling software systems, which means
Animal. A full discussion of how and when to use generalization (especially versus interface
you're probably confronting this rich and expressive language more than ever before. And
realization) is the subject for an object-oriented analysis and design book and isn't covered
even though you may not write UML diagrams yourself, you'll still need to interpret
here.
diagrams written by others.
Generalizations are usually read as "...is a...", starting from the more specific class and
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
reading toward the general class. Going back to the Cat and Dog example, you would say "a
you who must read, create, and understand system artifacts expressed using UML.
Cat...is a...Animal" (grammar aside).
Furthermore, it's been fully revised to cover version 2.0 of the language.
You show a generalization relationship with a solid line with a closed arrow, pointing from the
This comprehensive
new edition
only2-28
provides
a quick-reference
to all
2.0 diagram
specific
class to the general
class.not
Figure
shows
an example of the
CatUML
to Animal
types,
it
also
explains
key
concepts
in
a
way
that
appeals
to
readers
already
familiar
with
relationship.
UML or object-oriented programming concepts.

Topics include:

Figure 2-28. Cat specializes the Animal base class


The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
Unlike associations, generalization relationships are typically not named and don't have any
quickly familiarize yourself with the system.
kind of multiplicity. UML allows for multiple inheritance, meaning a class can have more than
one generalization with each representing an aspect of the decedent class. However, some
modern languages (e.g., Java and C#) don't support multiple inheritance; interfaces and
interface realization are used instead.

www.it-ebooks.info

2.6.6. Association Classes


UML 2.0 in a Nutshell

Often the relationship between two elements isn't a simple structural connection. For
ByDan Pilone,Neil Pitman
example, a football player may be associated with a league by virtue of being on a team. If
...............................................
the association between two elements is complex, you can represent the connection using an
Publisher:O'Reilly
association classPub
. An
association class is an association that has a name and attributes, like a
Date: June 2005
normal class. You
show
an association class like a regular class with a dashed line connecting
ISBN:0-596-00795-7
it to the association
it
represents.
Figure 2-29 shows a football player's relationships to a
Pages:234
league.
Table of Contents | Index

Figure 2-29. Example association class


System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive
not onlywith
provides
a quick-reference
all UML
2.0 diagram
When
translated into new
code,edition
relationships
association
classes oftentoresult
in three
classes:
types,
it
also
explains
key
concepts
in
a
way
that
appeals
to
readers
already
familiar
one for each end of the association and one for the association class itself. There may with
or may
UML
programming
concepts.
not
beora object-oriented
direct link between
the association
ends; the implementation may require you to
traverse through the association class to get to the opposite end of the link. In other words,
Topics include: may not have a direct reference to FootballLeague but may have a reference
FootballPlayer
toFootballTeam instead. FootballTeam would then have a reference to FootballLeague. How
the relationships are constructed is a matter of implementation choices; however, the
The role and value of UML in projects
fundamental concept of an association class is unchanged.
The object-oriented paradigm and its relation to the UML
integrated approach
to UML diagrams
2.6.7.AnAssociation
Qualifiers
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
Relationships
between elements
and Deployment
Diagramsare often keyed, or indexed, by some other value. For
example, a bank patron may be identified by her account number, or a tax payer by his Social
Security
number.Mechanisms
UML provides association qualifiers to capture such information. A qualifier
Extension
is typically an attribute of the target element, though this isn't required. You show a qualifier
by placing
a smallConstraint
rectangle Language
between the
association and the source element. Draw the name
The Object
(OCL)
of the qualifier (usually the name of an attribute) in the rectangle. Figure 2-30 shows the
relationship between the IRS and a taxpayer qualified by the taxpayer's Social Security
number.
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

Figure 2-30. An association qualifier

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
Notice
that and
the multiplicity
between The
the Unified
association
qualifier
and TaxPayer
is one
1. Obviously
construct,
document systems.
Modeling
Language
(UML) is
of those the
IRS
is associated
with more
than one
, but by to
using
qualifiers,
indicate
that a
languages.
UML makes
it possible
forTaxPayer
team members
collaborate
by you
providing
a common
socialSecurityNumber
uniquely
identifies
a
single
TaxPayer
within
the
IRS
.
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
2.7. Interfaces
...............................................
Publisher:O'Reilly
Pub Date: June 2005
0-596-00795-7
Aninterface is a ISBN:
classifier
that has declarations of properties and methods but no
Pages:
implementations.
You234
can use interfaces to group common elements between classifiers and

provide a contract a classifier that provides an implementation of an interface must obey. For
example, you can create an interface named Sortable that has one operation named
Table of Contents | Index
comesBefore(...)
. Any class that realizes the Sortable interface must provide an
implementation of comesBefore(...).
Some
modern
languages,
such modeling
as C++, don't
support
concept
interfaces;
UML
System
developers
have used
languages
forthe
decades
to of
specify,
visualize,
interfaces
are
typically
represented
as
pure
abstract
classes.
Other
languages,
such
as Java,
construct, and document systems. The Unified Modeling Language (UML) is one of those
do
support interfaces
butit don't
allow
have properties.
The moral
is that you
should be
languages.
UML makes
possible
forthem
teamtomembers
to collaborate
by providing
a common
aware
of how
model
going to be
implemented
whenEssentially,
modeling your
system.
language
thatyour
applies
to aismultitude
of different
systems.
it enables
you to
communicate solutions in a consistent, tool-supported language.
There are two representations for an interface; which one you should use depends on what
you're
to show.
Thethe
first
representation
the
standard
UML classifier
notation
the
Today,trying
UML has
become
standard
method isfor
modeling
software
systems,
which with
means
stereotype
interface
.Figurethis
2-31
shows
the Sortable
interface.
you're probably
confronting
rich
and expressive
language
more than ever before. And

even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.

Figure
2-31.
interface
UML 2.0 in a Nutshell from
O'Reilly
feelsThe
your Sortable
pain. It's been
crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The second representation of an interface is the ball-and-socket notation. This representation
paradigm
and
its relation
to thefor
UML
showsThe
lessobject-oriented
detail for the interface
but
is more
convenient
showing relationships to classes.
The interface is simply shown as a ball with the name of the interface written below it. Classes
An integrated
approach
toshown
UML diagrams
dependent
on this interface
are
attached to a socket matching the interface. Figure 232 shows the Sortable interface using the ball-and-socket notation.
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms

Figure 2-32. Examples of providing and requiring interfaces

The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

Because an interface specifies the contract only for a set of features, you can't instantiate an
interface directly. Instead, a class is said to realize an interface if it provides an
implementation
for the
operations
and properties.
realization
using
a dashed line
System developers
have
used modeling
languagesYou
for show
decades
to specify,
visualize,
starting
at the
classifier
and
leading
to Modeling
the interface,
with a(UML)
closedis arrowhead
at the
construct,
andrealizing
document
systems.
The
Unified
Language
one of those
end.
ClassesUML
thatmakes
are dependent
onfor
theteam
interface
are shown
using a dashed
line with
an open
languages.
it possible
members
to collaborate
by providing
a common
arrow
(dependency).
2-33 shows
a class that
realizes
the Sortable
interface
and
language
that appliesFigure
to a multitude
of different
systems.
Essentially,
it enables
you
to a
class
that is dependent
it.consistent, tool-supported language.
communicate
solutions on
in a

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though
you may
not write
UML diagrams
yourself, you'll
still need
to interpret
Figure
2-33.
Person
realizes
the Sortable
interface
and
Alphabetizer
diagrams written by others.
depends on it
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
Providing
implementation
of an operation
The an
Object
Constraint Language
(OCL) is straightforward. You must provide an
implementation on a realizing classifier with the same signature as the operation on the
interface. Typically there are semantic constraints associated with an operation that must be
honored by any implementation. Realizing a property is more subtle. A property on an
If you're states
new tothat
UML,
a tutorial
with
realistic
even
been
to helpby
you
interface
any
class that
realizes
theexamples
interfacehas
must
store
theincluded
data specified
the
quickly
familiarize
yourself
with
the
system.
propertyin some way . A property on an interface doesn't necessarily mean there will be an
associated property on a realizing classifier. However, the classifier must be able to store the
data represented by the property and provide a means to manipulate it.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
2.8. Templates
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
0-596-00795-7
Just as interfaces
allow
you to provide specifications for objects your class will interact with,
234 abstractions for the type of class your class may interact with. For
UML allows you Pages:
to provide

example, you can write a List class that can hold any type of object (in C++ this would
probably be a void*, in Java and C# it would probably be an Object). However, while you
Table of Contents
| Indexclass to be able to support any type of object, you want all of the objects in
wanted
your List
a given list to be of the same type. UML allows you to create and specify these kinds of
abstractions using templates .
System developers have used modeling languages for decades to specify, visualize,
You
can indicate
that a class
is a templated
(also
called parameterized
) class
by drawing
construct,
and document
systems.
The Unified
Modeling
Language (UML)
is one
of those a
dashed
rectangle
in the upper-right
corner
the class.toFor
each element
you would
like to
languages.
UML makes
it possible for
teamofmembers
collaborate
by providing
a common
template,
to specify
a nameof
todifferent
act as a systems.
placeholder
for the actual
type. you
Write
language you
thatneed
applies
to a multitude
Essentially,
it enables
to the
placeholder
name
in the in
rectangle.
Figure
2-34 shows an
example of a List class that can
communicate
solutions
a consistent,
tool-supported
language.
support any type.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
Figure 2-34. A templated List class
diagrams written by others.

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
This example uses ElementType as the name of the templated type for
clarity. In practice,
is its
often
abbreviated
to just T.
The object-oriented
paradigmthis
and
relation
to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
You can
have
multiple templated
and
Deployment
Diagrams types within a single class; just separate the type names
with a comma (,). If you need to restrict the types the user may substitute, show that with a
colon (Extension
:) followed
by the type name. Figure 2-35 shows a more complicated version of the
Mechanisms
List class that requires a Sorter along with the type of object to store in the list.
The Object Constraint Language (OCL)

Figure 2-35. A templated class with type restrictions

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Specifying restrictions on a type that may be used is functionally similar to specifying an


interface for a templated member, except that the user may be able to further restrict an
Table of Contents
| Index
instance
of your
class by specifying a subclass of your type.
When a user creates an instance of a List, she needs to specify the actual type to use in
place
of ElementType
. Thisused
is called
binding
a type tofor
a template.
You
show visualize,
binding with the
System
developers have
modeling
languages
decades to
specify,
keyword
bind
,
followed
by
a
type
specification
using
the
following
syntax:
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
that applies
to a multitude
of different systems. Essentially, it enables you to
<language
TemplatedType
-> RealType
>
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're
confronting
thiswhenever
rich and expressive
moreclass
thantoever
before.
You
canprobably
use the binding
syntax
you refer tolanguage
a templated
indicate
youAnd
want
even
though
you
may
not
write
UML
diagrams
yourself,
you'll
still
need
to
interpret
to use a bound version of that class. This is called explicit binding . For example, Figure 2-36
diagrams
written of
byList
others.
shows
a subclass
called EmployeeList that binds the ElementType of List to a class
namedEmployee.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

Figure 2-36. Explicit template binding

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)
Thebind keyword also indicates what types should be used with an instance of a template.
This is called implicit binding and is shown in Figure 2-37.
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

Figure 2-37. Implicit template binding

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
2.9. Variations
on Class Diagrams
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Because class diagrams
model structures well, they can be used to capture well-defined,
Pages:234Class diagrams have been used to capture XML and database
hierarchical information.

schemas with some degree of success. In the interest of full disclosure, people who deal with
XML and database schemas extensively have reservations about using class diagrams to
Table of Contents
| Index
capture
the information,
specifically because class diagrams are so generic. Each domain has
its own notation that may be better suited to capturing complex relationships or domainspecific information. However, UML has the benefit of being a common language that is
understood
by thosehave
outside
the
XML andlanguages
database for
domains.
System developers
used
modeling
decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language
that Schemas
applies to a multitude of different systems. Essentially, it enables you to
2.9.1.
XML
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
The structural design of an XML document can be captured in an XML schema. XML schemas
you're probably confronting this rich and expressive language more than ever before. And
are to XML documents as classes are to objects; XML documents are instances of a schema.
even though you may not write UML diagrams yourself, you'll still need to interpret
Therefore, it's not a giant leap to realize that class diagrams can be used to model XML
diagrams written by others.
schemas. XML schemas are described using the XML Structure Definition Language (XSDL).
XSDL is a text language (as opposed to the graphical nature of UML) and can be verbose;
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
mapping XSDL to UML can make it much easier to digest a schema document.
you who must read, create, and understand system artifacts expressed using UML.
Furthermore,
it'selements
been fullyofrevised
to cover
version 2.0
of the
language.
The
fundamental
XSDL are
XML elements,
which
are
connected in sequences,
choices, and complex structures. Each element may have extra information attached to it
This comprehensive
new edition
not only
providestypically
a quick-reference
to allelements
UML 2.0 as
diagram
using
(conveniently enough)
attributes.
Modelers
represent XML
classes
types,
it
also
explains
key
concepts
in
a
way
that
appeals
to
readers
already
familiar
with
and XSDL attributes as UML attributes. Each element is linked to the next using composition
UML or Multiplicity
object-oriented
programming
concepts.
arrows.
specifications
on the
relationships show how many times one element
appears within another. Example 2-1 is a sample XML document that describes a piece of
Topics include:
equipment.

The role and value of UML in projects

Example 2-1. A sample XML document


The object-oriented paradigm and its relation to the UML
<?xml An
version="1.0"
encoding="UTF-8"?>
integrated approach
to UML diagrams
<equipmentlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="equipment.xsd">
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
<equipment
equipmentid="H-1">
and Deployment
Diagrams
<shortname>
Extension
Mechanisms lang="en">Hammer</langstring>
<langstring
</shortname>
The<technicalcontact>
Object Constraint Language (OCL)
<contact>
<name>Ron</name>
<telephone>555-1212</telephone>
If you're new to UML, a tutorial with realistic examples has even been included to help you
</contact>
quickly familiarize yourself with the system.
</technicalcontact>
<trainingcontact>
<contact>
<name>Joe</name>
<email>joe@home.com</email>
</contact>

www.it-ebooks.info

</trainingcontact>
</equipment>
</equipmentlist>
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................

Example 2-2 is the


XSDLO'Reilly
that describes the XML document.
Publisher:

Example

Pub Date: June 2005


ISBN:0-596-00795-7
Pages:
234 schema
2-2.
XML

describing Example 2-1

<?xml
version="1.0"
encoding="ISO-8859-1"?>
Table of Contents
| Index
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">

System developers have used modeling languages for decades to specify, visualize,
<!-- ~Class:
contact
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--> is one of those
construct,
and document
systems.
The Unified Modeling Language (UML)
<xs:element
name="contact"
type="contact"/>
languages.
UML makes
it possible for
team members to collaborate by providing a common
<xs:complexType
language
that applies name="contact">
to a multitude of different systems. Essentially, it enables you to
<xs:sequence>
communicate
solutions in a consistent, tool-supported language.
<xs:element name="name" type="xs:string"/>
<xs:choice>
Today, UML has become the standard method for modeling software systems, which means
<xs:element
name="telephone"
type="xs:string"/>
you're probably
confronting
this rich and expressive
language more than ever before. And
<xs:element
type="xs:string"/>
even though
you may notname="email"
write UML diagrams
yourself, you'll still need to interpret
diagrams</xs:choice>
written by others.
</xs:sequence>
</xs:complexType>
UML
2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
<!-- ~Class:
equipment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
Furthermore,
it's been
fully revised
to cover version 2.0 of the language.
<xs:element name="equipment" type="equipment"/>
<xs:complexType
name="equipment">
This
comprehensive new
edition not only provides a quick-reference to all UML 2.0 diagram
<xs:sequence>
types, it also explains key concepts in a way that appeals to readers already familiar with
<xs:element programming
ref="shortname"/>
UML or object-oriented
concepts.
<xs:element name="technicalcontact" type="technicalcontact"/>
<xs:element name="trainingcontact" type="trainingcontact"/>
Topics include:
</xs:sequence>
<xs:attribute name="equipmentid" type="xs:string" use="required"/>
The role and value of UML in projects
</xs:complexType>
The~Class:
object-oriented
paradigm ~~~~~~~~~~~~~~~~~~~~~~~~~~~
and its relation to the UML
<!-equipmentlist
-->
<xs:element name="equipmentlist" type="equipmentlist"/>
An integrated approach
to UML diagrams
<xs:complexType
name="equipmentlist">
<xs:sequence>
Class<xs:element
and Object, Use
Case, Sequence,minOccurs="1"
Collaboration, Statechart,
Activity, Component,
ref="equipment"
maxOccurs="unbounded"/>
and
Deployment Diagrams
</xs:sequence>
</xs:complexType>
Extension Mechanisms
<!-<<XSDtopLevelAttribute>>
lang~~~~~~~~~~~~ -->
The~Class:
Object Constraint
Language (OCL)
<xs:attribute name="lang" type="xs:language"/>
<!-- ~Class: langstring ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<xs:element
name="langstring"
type="langstring"/>
If you're
new to UML,
a tutorial with realistic
examples has even been included to help you
<xs:complexType
name="langstring">
quickly
familiarize yourself
with the system.
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="lang" use="required">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">

www.it-ebooks.info

<xs:enumeration value="en"/>
<xs:enumeration value="fr"/>
</xs:restriction>
UML
2.0 in a Nutshell
</xs:simpleType>
ByDan Pilone,Neil Pitman
</xs:attribute>
</xs:extension>
...............................................
Publisher:O'Reilly
</xs:simpleContent>
Pub Date: June 2005
</xs:complexType>
ISBN:0-596-00795-7
Pages:
234
<!-- ~Class:
shortname
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<xs:element name="shortname" type="shortname"/>
<xs:complexType name="shortname">
Table of Contents
| Index
<xs:sequence>
<xs:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
System
developers have used modeling languages for decades to specify, visualize,
</xs:complexType>
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages.
UML makes
it possible for team
members to collaborate by
<!-- ~Class:
technicalcontact
~~~~~~~~~~~~~~~~~~~~~~~~
-->providing a common
language
that applies
to a multitude of different
systems. Essentially, it enables you to
<xs:element
name="technicalcontact"
type="technicalcontact"/>
communicate
solutionsname="technicalcontact">
in a consistent, tool-supported language.
<xs:complexType
<xs:sequence>
Today, UML
has become ref="contact"
the standard method
for modeling
software systems, which means
<xs:element
minOccurs="1"
maxOccurs="unbounded"/>
you're </xs:sequence>
probably confronting this rich and expressive language more than ever before. And
even
though you may not write UML diagrams yourself, you'll still need to interpret
</xs:complexType>
diagrams written by others.
<!-- ~Class: trainingcontact ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
UML
2.0 in a Nutshell
from O'Reilly feels yourtype="trainingcontact"/>
pain. It's been crafted for professionals like
<xs:element
name="trainingcontact"
you<xs:complexType
who must read, create,
and understand system artifacts expressed using UML.
name="trainingcontact">
Furthermore,
it's been fully revised to cover version 2.0 of the language.
<xs:sequence>
<xs:element ref="contact" minOccurs="1" maxOccurs="unbounded"/>
This comprehensive
new edition not only provides a quick-reference to all UML 2.0 diagram
</xs:sequence>
types,
it also explains key concepts in a way that appeals to readers already familiar with
</xs:complexType>
UML
or object-oriented programming concepts.
</xs:schema>

Topics include:
Figure 2-38 is a UML representation of the schema. Elements are represented as classes, with
The role and
of definition
UML in projects
one exception:
the value
contact
includes a choice option. Figure 2-38 represents this
using another class stereotyped as XSDchoice, and the options are represented as attributes
object-oriented paradigm and its relation to the UML
of the The
class.

An integrated
approach
to UML
So, while
UML simplifies
a schema
by diagrams
representing the information graphically, details such as
sequencing and type information can be lost without using a UML extension mechanism such
Class and
Use Case, Sequence, Collaboration, Statechart, Activity, Component,
as constraints
orObject,
stereotypes.
and Deployment Diagrams
Extension Mechanisms

2.9.2. Database Schemas


The Object Constraint Language (OCL)
By mapping database tables to classes and table rows to attributes, you can capture a
database schema fairly well using UML. Additional information such as primary keys, foreign
If you're
to UML,can
a tutorial
with realistic
examples
has even
been included
help
you
keys,
and new
constraints
be captured
using UML
constraints
or stereotypes.
Youtocan
show
quickly
familiarize
yourself
with
the
system.
relationships between tables using associations between classes (usually composition
relationships, but that is just by convention). Figure 2-39 shows a sample database schema
represented using a UML class diagram.
As with XML schemas, few professional database administrators model databases using class
diagrams. UML class diagrams are useful for conveying schema information in a common

www.it-ebooks.info

language, but they lack the expressive (and custom) capabilities of the more standard
database notation, Entity Relation Diagrams (ERDs).
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman

Figure ...............................................
2-38. A class diagram representation of Example 2-2
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

Figure
2-39.
Topics
include:

An example database schema using a class diagram

The role and value of UML in projects


The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

Chapter 3. Package Diagrams

...............................................
Publisher:O'Reilly
Pub Date: June 2005
Packages provide
a way to group related UML elements and scope their names. For example,
ISBN:0-596-00795-7
you can put all elements
Pages:234 having to do with 3D rendering into a package named 3DGraphics.

Package diagrams provide a great way to visualize dependencies between parts of your
system and are often used to look for problems or determine compilation order.
Table of Contents | Index

Nearly all UML elements can be grouped into packages, including packages themselves. Each
package has a name that scopes each element in the package. For example, if you had a class
namedTimer in a package named Utilities, the fully qualified name for the class is
System developers have used modeling languages for decades to specify, visualize,
Utilities::Timer. Elements in the same package can refer to each other without qualifying
construct, and document systems. The Unified Modeling Language (UML) is one of those
their names.
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
3.1. Representation
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
You show a package
using a rectangle with a tab attached to the top left. Figure 3-1 shows
Pages:234
theUtilities package.

Table of Contents | Index

Figure 3-1. A simple package


System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
You can show the elements contained within a package in two different ways. First, you can
UML 2.0
a Nutshell
from O'Reilly
your pain.
beenthem
crafted
for professionals
like
show
the in
elements
contained
within feels
the package
by It's
drawing
inside
the large rectangle.
read, create, and
understand
artifacts expressed
Ifyou
youwho
usemust
this representation,
write
the namesystem
of the package
in the tab. using
FigureUML.
3-2 shows the
Furthermore,
been fully
revisedinside
to cover
version
2.0 of
language.
contents
of theit's
Utilities
package
of the
package.
Tothe
refer
to the Timer class from
outside of the Utilities package, you say Utilities::Timer.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

Figure 3-2. Several classes contained inside the Utilities package


Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)
The second representation uses a solid line pointing from the package to each contained
element.
a circle
with awith
plusrealistic
sign in examples
it at the end
the included
package to
to help
indicate
If you're You
newplace
to UML,
a tutorial
hasnearest
even been
you
containment.
If youyourself
use thiswith
representation,
quickly familiarize
the system.you should show the name of the package in the
large rectangle rather than in the tab. This notation allows you to show more detail of the
packaged elements. Figure 3-3 shows the same Utilities package but with the classes
broken out.

www.it-ebooks.info

Figure 3-3. Elements owned by a package, shown outside of the


package
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language
that applies
multitude
of different
systems.
youare
to
You
don't need
to showtoalla the
elements
contained
within aEssentially,
package; if itnoenables
elements
communicate
solutions
in
a
consistent,
tool-supported
language.
shown, no assumptions can be made about what the package contains.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
3.2. Visibility
...............................................
Publisher:O'Reilly
Pub Date: June 2005
0-596-00795-7
A package may ISBN:
specify
visibility information for owned and imported elements, however
Pages:
234 one of two levels of visibility: public or private. Public visibility means
elements may have
only

the element may be used outside the package (scoped by the package name). Private
visibility means the element may be used only by other elements of the same package.
Table of Contents
| Index
Private
visibility
is useful for marking utility classes that help implement a subsystem or
component you don't want to expose to the rest of the system.
You
showdevelopers
public visibility
placing
a plus
sign before
element
name. You
show private
System
have by
used
modeling
languages
for the
decades
to specify,
visualize,
visibility
using
a
minus
sign.
Figure
3-4
shows
the
Utility
package
with
some
private
helper
construct, and document systems. The Unified Modeling Language (UML) is one
of those
classes.
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Figure
The Utilities
package
public
and private
members
Today,
UML3-4.
has become
the standard
method with
for modeling
software
systems, which
means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
3.3. Importing
and Accessing Packages
...............................................
Publisher:O'Reilly
Pub Date: June 2005
0-596-00795-7
When accessingISBN:
elements
in one package from a different package, you must qualify the
Pages:234
name of the element
you are accessing. For example, if Car is a class in the transportation

package and you are trying to access it from a package named RoutePlanning, you need to
qualifyCar as transportation::Car.
Table of Contents | Index

To simplify accessing elements in a different package, UML allows a package to import


another package. Elements of the imported package are available without qualification in the
importing
package. So,
if the
package
transportation
System developers
have
usedRoutePlanning
modeling languages
forimported
decadesthe
to specify,
visualize,package,
you
can
refer
to
Car
without
any
qualifications
from
within
the
RoutePlanning
package.
construct, and document systems. The Unified Modeling Language (UML) is one
of those
languages. UML makes it possible for team members to collaborate by providing a common
To
show a that
package
import,
you draw a
line
with anEssentially,
open arrowitfrom
the importing
language
applies
to a multitude
ofdashed
different
systems.
enables
you to
package
to
the
imported
package.
Label
this
line
with
the
import
keyword.
Figure 3-5 shows
communicate solutions in a consistent, tool-supported language.
theRoutePlanning package importing the transportation package.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
Figurewritten
3-5. by
RoutePlanning
importing the Transportation package
diagrams
others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
By default, imported elements are given public visibility in the importing package. UML allows
role that
and value
of UML
in projects
you toThe
specify
imported
elements
should be given private visibility, meaning they can't be
used by anyone outside the importing package (including any packages that may import that
The object-oriented
paradigmelements
and its relation
the private
UML visibility, you use the
package).
To specify that imported
should to
have
access keyword rather than the import keyword. Figure 3-6 shows the RoutePlanning
An importing
integratedthe
approach
to UML diagrams
package
TRansportation
package and accessing the Algorithms package. If a
package imports the RoutePlanning package, both packages can use public elements from
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
TRansportation, but they can't use anything in Algorithms.
and Deployment Diagrams

Extension Mechanisms

Figure
importing
the Transportation package but
The 3-6.
ObjectRoutePlanning
Constraint Language
(OCL)
accessing only the Algorithms package
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

What package import and access actually mean in implementation can vary dramatically
depending
on your target
language.
For example,
Java have
an explicit
concept of
System developers
have used
modeling
languagesC#
forand
decades
to specify,
visualize,
packages
and
importing
elements
from
packages.
Java
developers
often
import
java.util
construct, and document systems. The Unified Modeling Language (UML) is onethe
of those
package
intoUML
theirmakes
program
so theyfor
canteam
reference
the Java
Vector class
without qualifying
it.
languages.
it possible
members
to collaborate
by providing
a common
However,
has a somewhat
subtler
packages,
called namespaces.
Howto
language C++
that applies
to a multitude
of concept
differentofsystems.
Essentially,
it enables you
packages
map solutions
to an implementation
language
is often up
to the implementer.
communicate
in a consistent,
tool-supported
language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
3.4. Merging
Packages
...............................................
Publisher:O'Reilly
Pub Date: June 2005
0-596-00795-7
UML supports a ISBN:
somewhat
complex concept of merging packages. Merging packages differs
234 in that merge, by definition, creates relationships between classes of
from importing Pages:
packages

the same name. The motivation behind package merging comes directly from the evolution of
UML from 1.x to 2.0. UML 2.0 defines the base concept of elements and allows specific
Table of Contents
| Index
diagram
types
to extend a base concept without needing to provide a new name for it. For
example, UML extends several core Behavioral State Machine concepts into Protocol State
Machine concepts while retaining their original name.
System developers have used modeling languages for decades to specify, visualize,
When
a package
merges another
package,
any class
of the
same type
andisname
construct,
and document
systems.
The Unified
Modeling
Language
(UML)
one of those
automatically
extends
(or
a generalization
relationship
to) the original
class. For
example,
languages. UML
makes
it has
possible
for team members
to collaborate
by providing
a common
UML
can define
the concept
of the include
relationship
at aEssentially,
generic level
and thenyou
specialize
it
language
that applies
to a multitude
of different
systems.
it enables
to
for
use cases inclusion
the name
include. This
type of extension has simplified the
communicate
solutionsand
in aretain
consistent,
tool-supported
language.
internals of the UML model but rarely makes an appearance in real-world development.
Today, UML has become the standard method for modeling software systems, which means
You
show
package
merging using
a dashed
line with an
open arrow
merging
you're
probably
confronting
this rich
and expressive
language
morefrom
thanthe
ever
before.package
And
to
the though
mergedyou
package.
Label
this
linediagrams
with the yourself,
keyword you'll
merge
.Figure
shows an
even
may not
write
UML
still
need 3-7
to interpret
example
merging
packages.
diagramsofwritten
bytwo
others.

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Figure 3-7.
ProtocolStateMachines
the elements from
Furthermore,
it's been
fully revised to cover versionmerging
2.0 of the language.

BehavioralStateMachines so it can add to the contained classes

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
The rules for package merge are:
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment
Diagrams
Private
members of
a package aren't merged with anything.
Extension
Mechanisms
Classes
in the
package performing the merge that have the same name and type as
classes in the merged package(s) get a generalization relationship to the merged
The Object Constraint Language (OCL)
class(es). Note that this can result in multiple inheritance, but UML allows this.
You can still reference any of the original classes by explicitly scoping the class using the
original package name.
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.
Classes that exist only in the merged package or the merging package remain
unchanged and are added to the merging package.
Subpackages within the merged package are added to the merging package if they don't
already exist.

www.it-ebooks.info

If a subpackage with the same name already exists in the merging package, another
merge is started between the two subpackages.
UMLimports
2.0 in a Nutshell
Any package
from the merged package become package imports from the
merging package.
Elements
that are imported aren't merged (i.e., aren't given
ByDan Pilone,
Neil Pitman
generalization
relationships). If an imported element conflicts with an element in the
...............................................
merging package,
merging package's element takes precedence and the imported
Publisher:the
O'Reilly
Pub Date:
June 2005
element must
be explicitly
qualified.
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
3.5. Variations
on Package Diagrams
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
This section presents
two applications of class package diagrams and one application of use
234 layering and simplification always motivate packaging, the term
case packages. Pages:
Although

"simplification" means different things to different people. Simplification can mean:


Table of Contents | Index

Easier to build and test


Better tracking and project transparency
System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
Working at a stable overview without the noise of low-level churn
languages. UML makes it possible for team members to collaborate by providing a common
language
that applies
to a distributed
multitude ofteams
different systems. Essentially, it enables you to
Less conflict
between
communicate solutions in a consistent, tool-supported language.
Easy refactoring and extension
Today, UML has become the standard method for modeling software systems, which means
you're probably
confronting
this apparent
rich and expressive
more than ever
before.
And
Simplification
likely
means more
complexitylanguage
to some constituency.
Unless
your
even though
you may
notdiverse
write UML
diagrams
yourself,
stillcomplaints
need to interpret
packaging
balances
these
needs,
you are
likely toyou'll
receive
of unnecessary
diagrams written
by others.
complexity,
no matter
how noble your motives are.

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
3.5.1.
Structuring a Project with Package Diagrams
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
Class
organize
a logical
system
during
construction.
They provide
the
terms with
for
types,packages
it also explains
key
concepts
in a way
that
appeals to readers
already
familiar
management
and external
stakeholders,
as well as structure to contain all classes and code to
UML or object-oriented
programming
concepts.
be built. Class package diagrams are the UML equivalent of block diagrams.
Topics include:
Different parties think of a project according to their different needs. Programmers think in
terms of language and tactical design. Architects think in terms of dependencies, risk,
technology,
building,
testing,
andinOO
principles. Project managers think in terms of risk,
The role
and value
of UML
projects
tracking, resources, need, ownership, required skills, and delivery. Although all issues are
important,
and good packaging
recognizes
responsibility
to all needs, architects tend to
The object-oriented
paradigm
and itsits
relation
to the UML
identify top-level packaging with an eye on the control functions of project management. For
An integrated
approachmight
to UML
diagrams
example,
a project manager
draw
a package diagram for a web application such as that
shown in Figure 3-8.
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension
Figure Mechanisms
3-8. Top-level

packages defining a web application

The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
The
diagram
in Figure
3-8 carries very little meaning by itself. It must be accompanied by an
diagrams
written
by others.
auxiliary, textual document that describes the basis for the packaging. Such a document
might,
forinexample,
a list as feels
follows:
UML 2.0
a Nutshellcontain
from O'Reilly
your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
web
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types,Requires
it also explains
key concepts
in a way
appeals
to readerstechnology;
already familiar
special skills:
HTML, CSS,
and that
Struts,
a presentation
mostwith
UML or
object-oriented programming concepts.
dependencies.

Topics include:
database
The role and
value management
of UML in projects
Requires
database
and modeling skills; most independent/fewest
dependencies.
The object-oriented paradigm and its relation to the UML
user An integrated approach to UML diagrams

Class
Sequence,
To
be and
builtObject,
off-siteUse
by aCase,
remote
team. Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
search
The Object
Constraint
Language
(OCL) technology and techniques; self-contained
Requires
familiarity
with
search engine
subsystem.
If you're new to UML, a tutorial with realistic examples has even been included to help you
editing
quickly familiarize yourself with the system.
Comprises the basic editing features to be delivered in the first release; different skills
and different team.

rtf-editing

www.it-ebooks.info

Comprises those editing features scheduled for release 2.

x-editing

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

Comprises...............................................
editing features requested by a specific client. These features to be
O'Reilly
withdrawnPublisher:
or delayed
depending on that client. Risk is independent of the other
features. Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Figure 3-8 doesn't show the complete set of packages in the system. It is merely enough for
management to track and control the project. Programmers create lower-level packages as
needed for correct code design. Managers, however, allocate resources and track progress on
Table of Contents | Index
the relatively large grains of the project shown in Figure 3-8 without getting disturbed by the
addition or refactoring of internal packages and contents.

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
3.5.2.
UseUML
Case
Packages
languages.
makes
it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Use case packages organize the functional behavior of a system during analysis. Figure 3-9
shows
major
functional
areas
of a content
packages
provide
Today,the
UML
has become
the
standard
methodmanagement
for modeling system.
softwareThe
systems,
which
means
understandable
for team
the language
analyst team.
discuss
you're probablyterms
confronting
thismembers
rich and outside
expressive
moreManagers
than evercan
before.
Andthe
project
at an appropriate
ofUML
detail
without yourself,
getting bogged
down
in details.
even though
you may notlevel
write
diagrams
you'll still
need
to interpret
diagrams written by others.
The CMS system shown in Figure 3-9 comprises packages created for the following reasons:
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
The complex editing packages separate the preliminary delivery and the advanced
Furthermore, it's been fully revised to cover version 2.0 of the language.
delivery from the client-based delivery.
This The
comprehensive
new edition
only
providescontain
a quick-reference
to all
UML 2.0 diagram
simple interactions,
viewnot
and
feedback,
basic, low-risk
functions.
types, it also explains key concepts in a way that appeals to readers already familiar with
UML The
or object-oriented
programming
concepts.
reporting has more
sophisticated
functions.
Topics
include:
The
search and the user management separate complex functions.
Just as with the class packages in Figure 3-8, you manage the use case packages to manage
The role
and valuethat
of UML
in projects
the project.
Remember
tracking
use case packages tracks customer value.

The object-oriented paradigm and its relation to the UML

3.5.3.AnDirected
Dependency
Graphs
integrated approach
to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and
Deployment
Diagrams
Directed
dependency
graphs
of the packages in a system reveal nonfunctional issues related
to buildability, testability, and robustness; they provide a guide for several roles in software
Extension Mechanisms
development.
The Object Constraint Language (OCL)

Figure 3-9. A set of functional major use case packages


If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Object, Useflow
Case,
Sequence,
Collaboration,
Activity,
Component,
When Class
all theand
dependencies
in one
direction,
as in FigureStatechart,
3-10, without
any loops
or
Diagrams
cycles,and
theDeployment
graph is acyclic
. Acyclic graphs show a project in good health.
Extension
Mechanisms
Directed
dependency
graphs can help you avoid problems with build scripts and project
testing. Looking at Figure 3-10, you can see that refactoring timer will invalidate testing and
The Object
Constraint
(OCL)
potentially
break the
build ofLanguage
visualizers
,threads,controllers, and top; you should thus
change the timer package with caution.
Directed dependency graphs can also help you divide project work among different staff
If you're new
UML, a Figure
tutorial3-10
withshows
realistic
has even
beenthreads
included
to visualizers.
help you
members.
For to
example,
noexamples
dependencies
between
and
quickly
familiarize
yourself
with
the
system.
Thus, different groups of people can work on those two packages without destabilizing each
other.

Figure 3-10. Dependency graph of modified JMeter with no cycle

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Through time, projects evolve, and new dependencies creep in because of misunderstanding
Topics include:
or expediency. Figure 3-11 shows such a case; three bidirectional dependencies ruin the
desirable, acyclic nature of the graph:

The role and value of UML in projects


utils
now depends on
threads.and its relation to the UML
The object-oriented
paradigm
threads
now depends
on to
controllers
.
An integrated
approach
UML diagrams
samplers
depends
tHReads
.
Class andnow
Object,
Use on
Case,
Sequence,
Collaboration, Statechart, Activity, Component,

and Deployment Diagrams


The problem here is that the reverse of each dependency already existed in Figure 3-10. The
result Extension
is the tangle
of bidirectional arrows in level 1 of Figure 3-11, which contrasts with the
Mechanisms
clear flow of arrows in Figure 3-10. The further result is pain, for the developers, testers, and
likely, The
managers
users. Changes
threads will confound the team responsible for
Object and
Constraint
Languagein(OCL)
controllers and utils, and vice versa because fixes in one require fixes in the code or unit
tests of the others. It may take several iterations until all packages stabilize.[*]
[*] For new
more theory
and metrics
regarding
andexamples
their dependencies,
see John
Lakos'
Large-Scale
C++ Software
If you're
to UML,
a tutorial
withpackages
realistic
has even
been
included
to help
you
Design . Also see Robert C. Martin's http://c2.com/cgi/wiki?PrinciplesOfObjectOrientedDesign.
quickly
familiarize yourself with the system.

Figure 3-11. Dependency graph of modified JMeter with three cycles

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

Chapter 4. Composite Structures

...............................................
Publisher:O'Reilly
Pub Date: June 2005
As a system becomes
more complex, it is often helpful to decompose it in terms of
ISBN:0-596-00795-7
functionality (see
Chapter
Pages:234 7). To realize a piece of functionality, different elements of a

system often work together and communicate information. UML 2.0 formalizes the concept of
complex relationships between elements into the idea of composite structures. Much of the
material
in this
chapter is new to UML 2.0.
Table of Contents
| Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
4.1. Composite
Structures
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
Astructure is a set
of0-596-00795-7
interconnected elements that exist at runtime to collectively provide
Pages:234
some piece of functionality.
For example, you can use a structure to represent the internal

makeup of a classifier such as a subsystem (what objects are related to each other, who is
communicating with whom, etc.). UML calls such structures internal structures . UML defines
Table of Contents
| Index
several
symbols
to capture the relationships and communications between elements in an
internal structure.

System developers have used modeling languages for decades to specify, visualize,
construct,
and document systems. The Unified Modeling Language (UML) is one of those
4.1.1.
Connectors
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Connectors represent communication links between instances of classes participating in an
internal structure. They can be runtime instances of associations, or they can represent
Today, UML has become the standard method for modeling software systems, which means
dynamic communication set up at runtimefor example by being values of local variables. You
you're probably confronting this rich and expressive language more than ever before. And
show a connector as a solid line between two instances. Note that while associations between
even though you may not write UML diagrams yourself, you'll still need to interpret
classes represent a link between any instances of those classes, a connector represents a link
diagrams written by others.
between only the two instances specified at each end of the connector (see "Collaborations").
UMLcan
2.0provide
in a Nutshell
O'Reilly
feels your
It's beenusing
crafted
professionals
You
name from
and type
information
forpain.
a connector
the for
following
format:like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
name :classname
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
where:
Topics include:
name

The role and value of UML in projects


Is
the
name of the connector.
The its
name
can be
later in collaborations to reference
The
object-oriented
paradigm and
relation
to used
the UML
this connector.

An integrated approach to UML diagrams


classname
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,

and Deployment Diagrams


Is the name of an association this connector represents.
Extension Mechanisms
Figure 4-1 is an example of a named connector.
The Object Constraint Language (OCL)

Figure 4-1. The link between a Pedal and a Wheel is a connector


If you're new to UML, a tutorial
with realistic
examples
even been included to help you
named
"c," which
is has
a Chain
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

UML specifies several rules for determining the types of the elements at each end:
Table of Contents | Index

If a connector is an instance of an association, the types of the instances at either end of


the connector must be the same types at either end of the association.

System developers have used modeling languages for decades to specify, visualize,
If an instance
at one systems.
end of a connector
has
required
interfaces,
the instance
the
construct,
and document
The Unified
Modeling
Language
(UML)
is one of at
those
other end
the connector
must
one of those
interfaces.
languages.
UMLofmakes
it possible
for provide
team members
to collaborate
by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
If an instance at one end of a connector has required interfaces and a port is connected
communicate solutions in a consistent, tool-supported language.
to the other end of the connector, the port must provide a required interface.
Today,
UML
has become
the standard
method
for modeling
software itsystems,
which means
The
actual
means
of communication
isn't
specified
by the connector;
can represent
a simple
you're probably
confronting
this rich
and
expressive
language
more
ever before.
And
method
call or a complex
protocol
over
a socket
connection.
You
can than
constrain
the connection
even
though
you
may
not
write
UML
diagrams
yourself,
you'll
still
need
to
interpret
using the normal UML note notation. Simply specify the constraint in a note, and link it to the
diagrams using
written
others.
connector
a by
dashed
line. Figure 4-2 shows a constrained connector.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

Figure 4-2. A constrained connector

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)
You may specify the multiplicity of each connector end using the normal multiplicity syntax.
Simply write the number of instances for a given end near the end of the connector. For
example, a student/teacher relationship may require at least 5 students and no more than 20.
If you're
new the
to UML,
a tutorial with
realistic examples
hasineven
been
included to help you
You
can show
student/teacher
relationship
as depicted
Figure
4-3.
quickly familiarize yourself with the system.

Figure 4-3. A Teacher must have at least 5 Students but no more


than 20

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

4.1.2. Ports
Table of Contents | Index

Aport is a way to offer functionality from a composite structure without exposing the internal
details
ofdevelopers
how that functionality
is realized.
For example,
you may
a subsystem
System
have used modeling
languages
for decades
to have
specify,
visualize, that can
perform
credit
card
payment
verification.
The
actual
implementation
of
this
construct, and document systems. The Unified Modeling Language (UML) isfunctionality
one of thosemay
be
spread over
working
in conjunction.
The
organization
of these classes
can
languages.
UMLseveral
makesclasses
it possible
for team
members to
collaborate
by providing
a common
be
represented
as an internal
structure
thesystems.
subsystem,
and the overall
functionality,
or
language
that applies
to a multitude
of within
different
Essentially,
it enables
you to
credit
card verification,
exposed using
a port. Exposing
the functionality through a port
communicate
solutions can
in abe
consistent,
tool-supported
language.
allows the subsystem to be used by any other classifier that conforms to the port's
specifications.
Starting
with
2.0, classes
have
been extended
to allow
for ports
Today, UML has
become
theUML
standard
method
for modeling
software
systems,
whichand
means
internal
structures.
By default,
ports
however
UML 2.0
allows
tobefore.
have internal
you're probably
confronting
this
rich are
andpublic,
expressive
language
more
thanyou
ever
And
ports
are you
available
onlywrite
to the
composite
them.
even that
though
may not
UML
diagramsstructure
yourself,hosting
you'll still
need to interpret
diagrams written by others.
You show a port as a small square. You typically draw the name and multiplicity of the port
near
though
both
may be
hidden.
you It's
draw
the crafted
port onfor
theprofessionals
edge of a classifier,
UML the
2.0 square,
in a Nutshell
from
O'Reilly
feels
your Ifpain.
been
like
the
public
and create,
is available
to the environment.
If you draw
the port
inside
a classifier,
youport
whoismust
read,
and understand
system artifacts
expressed
using
UML.
the
port is protected
and
available
to theversion
composite
Figure 4-4 shows an
Furthermore,
it's been
fully
revisedonly
to cover
2.0 structure.
of the language.
example port.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

Figure 4-4. The CreditCardVerificationSubsystem with a single public


port, CreditCardServices
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms

4.1.2.1. Required and provided interfaces


The Object Constraint Language (OCL)

Ports are associated with required and provided interfaces (see "Interfaces" in Chapter 2).
Required interfaces show what the owning classifier may ask of its environment through a
given
port.new
Provided
interfaces
functionality
classifier
exposes
to the
If you're
to UML,
a tutorialshow
with what
realistic
examples ahas
even been
included
to help you
environment.
For example,
card payment system may provide an interface to verify
quickly familiarize
yourself our
withcredit
the system.
credit cards, CreditCardProcessor, while requiring access to an account verification system,
AccountServices, offered by the credit card company. If you use ports in your diagrams, the
required and provided interfaces capture all the interaction the system may have with a given
classifier. Provided and required interfaces are typically shown using the ball and socket
(lollipop) notation, though you may explicitly type a port (see "Port typing"). If there are

www.it-ebooks.info

multiple required or provided interfaces, simply list each interface name followed by a
comma; don't show multiple lollipops. Figure 4-5 shows a port with a required interface and
two provided interfaces.
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:
Figure 4-5.
TheO'Reilly
CreditCardVerificationSubsystem providing two
Date: June 2005
interfacesPub
(CreditCardProcessor
and CardHolderVerification) and
ISBN:0-596-00795-7
requiring
one
(AccountServices)
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.

4.1.2.2.
implementations
UML 2.0 Realizing
in a Nutshellport
from
O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
Ports are wired to an internal implementation using connectors. See "Connectors" for
This comprehensive
edition anot
only provides
quick-reference
to all
UML
2.0 diagram
information
on how tonew
represent
connector.
If theaclassifier
owning the
port
provides
the
types, it also explains
key conceptsitself,
in a way
that is
appeals
to readers
alreadyport
familiar
with
implementation
of the functionality
the port
considered
a behavioral
. In this
UML or
concepts.
case,
theobject-oriented
connector linksprogramming
to a state inside
the classifier. This state is used to explain the
behavior of the classifier when the port is used (see Chapter 8 for more information on using
Topicstoinclude:
states
model behavior). This is typically used for simple classifiers (not complex structures)
that implement functionality themselves. Figure 4-6 shows a behavioral port.
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML

Figure 4-6. A behavioral port

An integrated approach to UML diagrams


Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're
newhand,
to UML,
a tutorial
with realistic
examples
has even
been you
included
to help
you
On
the other
if the
functionality
is realized
by internal
elements,
link the
connector
quickly
familiarize
yourself
with
the
system.
to internal classifiers that provide the implementation. This is typically used for composite
structures such as components and subsystems. Figure 4-7 shows such a port.

Figure 4-7. A port linked to an internal implementation

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

4.1.2.3. Multiple connectors

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
UML
allows
you
to have
multiple
leading from
portneed
to different
internal
even2.0
though
you
may
not write
UMLconnectors
diagrams yourself,
you'lla still
to interpret
elements.
However,
it
doesn't
specify
what
happens
when
communication
is
received
at that
diagrams written by others.
port; this is left up to the modeler. Some possible solutions are to forward the communication
to
all connectors,
forward
based
on priority,
forward
round-robin
basis,
or simply like
UML
2.0 in a Nutshell
from
O'Reilly
feels your
pain. on
It'sabeen
crafted for
professionals
randomly
choose
a connector.
Regardless
of your
decision,
be expressed
sure to document
it in your
you who must
read,
create, and
understand
system
artifacts
using UML.
model,
probably
using
a
note
attached
to
the
port.
Figure
4-8
shows
an
example
of using a
Furthermore, it's been fully revised to cover version 2.0 of the language.
port with many connectors.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

Figure 4-8. A port with multiple connectors

Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

4.1.2.4. Port multiplicity


If you're new to UML, a tutorial with realistic examples has even been included to help you
familiarize
yourself
with thefor
system.
Aquickly
classifier
may specify
multiplicity
a port like any other element. Simply place the desired
number of port instances in brackets after the port name and type (if present). When the
classifier is instantiated, the associated ports are instantiated as well. These are called
interaction points and can be uniquely identified by the classifier. For example, if your
classifier has two ports, one with provided interfaces that offer anonymous access to data and
one with a provided interface that offers authenticated access to data, your classifier can

www.it-ebooks.info

distinguish which port was used by the external system. Figure 4-9 shows the credit card
verification system offering two instances of the credit card verification port.
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman

Figure 4-9................................................
A component with two instances of the CCServices port
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
4.1.2.5.
Port
language
thattyping
applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
In
practice,
a port isthe
instantiated,
it is represented
by asoftware
classifiersystems,
that realizes
Today,
UMLwhen
has become
standard method
for modeling
whichthe
means
provided
interfaces.
Any communication
this interaction
point
simply
the And
you're probably
confronting
this rich andwith
expressive
language
more
than passes
ever before.
information
toyou
internal
that diagrams
realize theyourself,
behavior.
UMLstill
2.0need
allows
to specify the
even though
may classifiers
not write UML
you'll
to you
interpret
type
of a port
using
diagrams
written
byclasses
others.to provide more sophisticated behavior. For example, you can
specify that the port is typed using a class that filters the communications it receives or
prioritizes
When
this
port isfeels
instantiated,
the
corresponding
has a chance
to
UML 2.0 indelivery.
a Nutshell
from
O'Reilly
your pain.
It's
been crafted class
for professionals
like
manipulate
the read,
communication
it understand
receives before
passing
it to expressed
the realizing
classifiers.
you who must
create, and
system
artifacts
using
UML. To
show
that a port
be represented
usingversion
a specific
simply follow the name of
Furthermore,
it'sshould
been fully
revised to cover
2.0classifier,
of the language.
the port with a colon and the name of the classifier to use. Note that the classifier must
realize
the provided interfaces.
You
use
this notation
to show provided
interfaces
by using
This comprehensive
new edition
notcan
only
provides
a quick-reference
to all UML
2.0 diagram
an
interface
asexplains
the portkey
type,
thoughinthe
lollipop
more
flexible.
Figurewith
4-10
types,
it also
concepts
a way
thatnotation
appealsistooften
readers
already
familiar
shows
explicitly typedprogramming
port.
UML oranobject-oriented
concepts.

Topics include:

Figure 4-10. A port explicitly typed as a PacketPrioritizer

The role and value of UML in projects

The object-oriented paradigm and its relation to the UML


An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

4.1.3. Structured Classes and Properties

www.it-ebooks.info

As described in Chapter 3, classifiers with whole-part relationships typically use composition


arrows to show their relationships. In the context of composite structures, UML 2.0 has
defined the term property to describe the "part" piece of the whole-part relationship. For
UML 2.0 inoperating
a Nutshell system, an application may be made up of a main window
example, in a graphical
ByDan The
Pilone,buttons
Neil Pitman
and several buttons.
are a part of the application, so that the whole-part
...............................................
relationship between
the application and the buttons can be shown using composition.
Publisher:
O'Reilly
However, the main
window
is shared with the operating system (so the system can reposition
Pub Date:
June
2005 the operating-system-to-window relationship is slightly
the window or hide
it); as
a result,
ISBN:
0-596-00795-7
weaker and is shown using association. You can model the application, window, and button
234
relationships as Pages:
shown
in Figure 4-11.

Table of Contents | Index

Figure 4-11. The Application, Window, Button relationship


System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
When used in composite structure diagrams, relationships between properties are shown in
Thisowning
comprehensive
edition This
not only
provides
quick-reference
all UML 2.0between
diagram
the
classifier'snew
rectangle.
allows
you to afurther
restrict thetoassociation
types,
also
explains key
concepts
a way that
appeals
readers
parts
ofitthe
composite
classifier.
For in
example,
Figure
4-11 to
shows
thatalready
Buttonsfamiliar
can be with
UML or object-oriented
programming
concepts.structure diagram, you can restrict the Window
associated
with any Window
. Using a composite
to be associated only with a Button owned by the same application. When you draw the
Topics include:
composite
structure diagram, properties that are associated with the composite structure
through composition are shown with solid rectangles, and properties that are shared with
other structures are shown using a dashed rectangle. You may place multiplicity information
The role in
and
of UML
in projects
for a property
itsvalue
rectangle
in the
upper right corner, or after the name of the property in
brackets.Figure 4-12 shows the composite structure diagram of application, window, and
The object-oriented paradigm and its relation to the UML
button relationships.
An integrated approach to UML diagrams
In addition to simply specifying how properties fit together, you can use composite structures
to specify
are Case,
instantiated.
As in
Chapter 3, instances
areActivity,
shown by
underlining
Classhow
andinstances
Object, Use
Sequence,
Collaboration,
Statechart,
Component,
the name
and
type
of
the
classifier.
You
may
specify
initial
values
for
each
attribute
of a
and Deployment Diagrams
classifier by specifying the name of the attribute followed by an equals sign and the value of
the attribute.
When
used as instances, you can specify the roles each property will take on by
Extension
Mechanisms
showing a slash "/" followed by the role name after the property name and type. Figure 4-13
showsThe
the Object
initialization
of a button
with(OCL)
its appropriate values.
Constraint
Language
You can show that the instance of the owning classifier is related to a particular constructor of
a classifier using a dependency line labeled with the keyword create. You can use any
If you're new
a tutorial
withinitializing
realistic examples
has
even by
been
included
to help you
parameters
to to
theUML,
constructor
when
properties
simply
using
the parameter
quickly
familiarize
yourself
the system.
name.
Figure
4-14 shows
thewith
application
composite diagram tied to a constructor on the
Application class.

Figure 4-12. The Application, Window, and Button relationships as a

www.it-ebooks.info

composite structure
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today,
UML4-13.
has become
the standard
method for structure
modeling software
which
means
Figure
Application
composite
withsystems,
property
values
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and
Object,
Use Case, Sequence,
Collaboration,
Statechart,
Component,
Figure
4-14.
Application
constructor
relating
to an Activity,
instance
of an
and Deployment Diagrams
Application
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
4.2. Collaborations
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
0-596-00795-7
One of the primary
purposes
for composite structures is to document how a particular piece of
Pages:234
functionality is implemented
within a system. This organization of elements to realize

behavior is called a collaboration . A collaboration is a collection of instances wired together


using connectors to show the communication flow.
Table of Contents | Index

Because the purpose of collaborations is to describe how a particular piece of functionality


works, details outside the scope of the desired functionality are typically left off a diagram.
Instead,
a collaboration
shows the
requiredfor
links
between
instances
and the
System developers
havediagram
used modeling
languages
decades
to specify,
visualize,
attributes
involved
in
the
collaboration.
You
may
have
multiple
collaborations
involving
the
construct, and document systems. The Unified Modeling Language (UML) is one
of those
same
instances
showing
different
each based
on the functionality
expressed.
One
languages.
UMLbut
makes
it possible
forviews
team of
members
to collaborate
by providing
a common
effective
showing
views
of a classifier
is to Essentially,
use interfaces
to collect
related
languageway
thatofapplies
to different
a multitude
of different
systems.
it enables
you
to
functionality.
single class
realize multiple
interfaces,
but each collaboration can focus
communicateAsolutions
in amay
consistent,
tool-supported
language.
on a single interface. See "Interfaces" in Chapter 2 for more information.
Today, UML has become the standard method for modeling software systems, which means
Within
collaboration,
it is helpful
to name
the instances
involved.
typically
name an
you're aprobably
confronting
this rich
and expressive
language
moreYou
than
ever before.
And
instance
basedyou
on may
its role
the collaboration.
example,
if you
the
even though
notinwrite
UML diagramsFor
yourself,
you'll
still wish
need to
to model
interpret
Observer/Observable
design pattern, you will likely have an instance in the role of Observer
diagrams written by others.
and an instance in the role of Subject.

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
You show a collaboration using a dashed ellipse with the name of the collaboration written
you who must read, create, and understand system artifacts expressed using UML.
inside.Figure 4-15 shows a collaboration named "Observer/Observable."
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
4-15.
A simple collaboration
UML or object-orientedFigure
programming
concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
Deployment
Diagrams
There and
are two
ways to render
the details of a collaboration. The first is to add a compartment
to the collaboration ellipse and draw the instances involved in the collaboration inside. Links
Extension Mechanisms
between instances are shown as solid lines. Each instance is named according to its role in the
collaboration.Figure 4-16 shows the internal structure of the Observer/Observable
The Object Constraint Language (OCL)
collaboration.

If you're new to UML, a tutorial with realistic examples has even been included to help you
Figure
4-16.
Internal
quickly familiarize
yourself
with the
system. details of a collaboration

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

Alternatively, you can show the instances that make up a collaboration outside of the
collaboration ellipse and use communication links to tie them back in. In this case, you don't
specify the role name inside the classifiers; instead, you write the role name along the
System developers have used modeling languages for decades to specify, visualize,
communication link for each instance. The advantage of this notation is that you can specify
construct, and document systems. The Unified Modeling Language (UML) is one of those
the attributes and operations that are involved in the collaboration (remember, you can leave
languages. UML makes it possible for team members to collaborate by providing a common
off any attribute or operation that isn't directly related to the functionality you are
language that applies to a multitude of different systems. Essentially, it enables you to
expressing). The disadvantage of this notation is that you don't model the direct
communicate solutions in a consistent, tool-supported language.
communication paths between the various instances. Figure 4-17 shows the
Observer/Observable pattern using this alternate notation.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.

Figure 4-17. The Observer/Observable collaboration with details


outside
offeels
theyour
collaboration
ellipse
UML 2.0 in a Nutshell from
O'Reilly
pain. It's been crafted
for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class
and Object,
Use Case,
Sequence,
Statechart,
Activity,
The UML
specification
makes
it clear
that any Collaboration,
classifier can be
substituted
for anyComponent,
member of
and Deployment
Diagrams
the collaboration
as long
as they provide the appropriate attributes and operations to fulfill
their role. For example, in the Observer/Observable collaboration shown in Figure 4-17, the
Extension
Observable
mustMechanisms
have a means of adding, removing, and notifying observers, and the
Observer must have a way to handle changes to the observable. Any other classifier may be
The
Object
Constraint
(OCL)
used in
this
collaboration
as Language
long as it can
provide the message font attribute and the
appropriate operation. As mentioned earlier, interfaces lend themselves nicely to
collaborations. You can define an Observable interface and programmatically capture exactly
what attributes and operations are needed to fulfill a role.
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly
yourself with
system. meaning you can attach sequence diagrams,
UML
2.0 familiarize
makes collaborations
fullthe
classifiers,
state machines, or any other behavioral diagram to help capture the details of the
implementation.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
4.3. Collaboration
Occurrences
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:a0-596-00795-7
UML 2.0 introduced
new concept to allow you to attach a collaboration to a specific
Pages:234
operation or classifier
to show how it is realized by other elements. When you associate a

collaboration with an operation or classifier, you create a collaboration occurrence . You can
think of collaboration occurrences as instances of collaborations. For example, you can use a
Table of Contents |occurrence
Index
collaboration
to document how various classes make up a subsystem, what is
responsible for persistence, what is really a faade to another subsystem, etc. The advantage
of using a collaboration occurrence to document the implementation of functionality is that
you
can assign
role names
to internal
elements
of the
There
mayvisualize,
be multiple
System
developers
have used
modeling
languages
forclassifier.
decades to
specify,
occurrences
of adocument
particularsystems.
collaboration
within aModeling
classifier,
each with
different
internal
construct, and
The Unified
Language
(UML)
is one
of those
elements
fulfilling
the roles
of the collaboration.
languages.
UML makes
it possible
for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
You
show a collaboration
using
the same dashed
ellipse used to show a
communicate
solutions inoccurrence
a consistent,
tool-supported
language.
collaboration, except that you list the name of the occurrence followed by a colon, and then
the
name
of the
type. Formethod
each role
in thesoftware
original collaboration,
you
draw
Today,
UML
has collaboration
become the standard
forused
modeling
systems, which
means
ayou're
dashed
line from
the collaboration
to thelanguage
element more
fulfilling
the
role.
You label
probably
confronting
this richoccurrence
and expressive
than
ever
before.
And the
dashed
line with
name
theUML
role.diagrams
For example,
a collaboration
occurrence
of our
even though
youthe
may
not of
write
yourself,
you'll still need
to interpret
Observer/Observable
collaboration is shown in Figure 4-18.
diagrams written by others.

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Two to
collaboration
Furthermore,Figure
it's been4-18.
fully revised
cover version 2.0occurrences
of the language.of the

Observer/Observable collaboration
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

Chapter 5. Component Diagrams

...............................................
Publisher:O'Reilly
Pub Date: June 2005
When modeling ISBN:
large0-596-00795-7
software systems it is common to break the software into manageable
subsystems. UML
provides
Pages:234 the component classifier for exactly this purpose. A component is a

replaceable, executable piece of a larger system whose implementation details are hidden.
The functionality provided by a component is specified by a set of provided interfaces that the
component
Table of Contentsrealizes
| Index (see "Black-Box View"). In addition to providing interfaces, a component
may require interfaces in order to function. These are called required interfaces .
The functionality of a component's provided interfaces is implemented with one or more
System developers have used modeling languages for decades to specify, visualize,
internal classifiers. These are typically classes but can be other components (see "White-Box
construct, and document systems. The Unified Modeling Language (UML) is one of those
View"). Components should be designed to be reused, with dependencies on external
languages. UML makes it possible for team members to collaborate by providing a common
interfaces, strong encapsulation, and high cohesion.
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
5.1. Components
...............................................
Publisher:O'Reilly
Pub Date: June 2005
0-596-00795-7
In UML 2.0, youISBN:
represent
a component with the classifier rectangle stereotyped as
Pages:
234
component. Like
other
classifiers, if the details of the component aren't shown, you place the

name of the component in the center of the rectangle. Optionally, you may show the
component icon (a rectangle with two smaller rectangles on the left side) in the upper-right
Table of Contents
Indexshows a simple component.
corner.
Figure| 5-1

System developers have used modeling languages for decades to specify, visualize,
construct, and documentFigure
systems.5-1.
The Unified
Modeling
Language (UML) is one of those
A simple
component
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
The representation for a component has changed from previous versions
This comprehensive
new
edition
not only provides
a quick-reference
to allrectangles:
UML 2.0 diagram
of UML.
UML
1.4 recognized
a, rectangle
with two smaller
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
This notation is still recognized for backward compatibility but is no
longer recommended.
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms

5.1.1. Component Dependencies


The Object Constraint Language (OCL)
Components may need other components to implement their functionality. You can show
component dependencies using the dependency relation (a dashed line with an open arrow)
If you'rethe
newtwo
to UML,
a tutorial
with realistic
examples
has even been included
to help
you
between
components.
Figure
5-2 shows
the AccountManagement
component
dependent
quickly
familiarize
yourself
with
the
system.
on two other components.

Figure 5-2. Component dependency

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

Representing component dependencies in this fashion is a relatively high-level view of a


system. To further refine the diagram you may want to show inter-component relationships as
System developers have used modeling languages for decades to specify, visualize,
dependencies on the interfaces provided by other dependent components (see "Black-Box
construct, and document systems. The Unified Modeling Language (UML) is one of those
View"; also see "Interfaces" in Chapter 2).
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
5.2. Component
Views
...............................................
Publisher:O'Reilly
Pub Date:
June 2005 a black-box view and a white-box view. The black-box
UML uses two views
of components,
ISBN:0-596-00795-7
view shows a component
from an outside perspective; the white-box view shows how a
Pages:
234
component realizes
the
functionality specified by its provided interfaces.

Table of Contents | Index

5.2.1. Black-Box View


The
black-box
view of
a component
shows
the interfaces
the component
provides,
the
System
developers
have
used modeling
languages
for decades
to specify,
visualize,
interfaces
it
requires,
and
any
other
detail
necessary
to
explain
the
guaranteed
behavior
construct, and document systems. The Unified Modeling Language (UML) is one of those of
the
component.
does not
specify for
anything
about theto
internal
implementation
of athe
languages.
UMLItmakes
it possible
team members
collaborate
by providing
common
component.
This
distinction
is central of
to different
the concept
of replaceable
components.
language that
applies
to a multitude
systems.
Essentially,
it enables you to

communicate solutions in a consistent, tool-supported language.


Today, UML
has become
the standard method for modeling software systems, which means
5.2.1.1.
Assembly
connectors
you're probably confronting this rich and expressive language more than ever before. And
even though
you
may not write
yourself,
you'll still
need
to interpret
When
modeling
a black-box
viewUML
of a diagrams
component,
you represent
the
provided
and required
diagrams
written
by
others.
interfaces using assembly connectors. Assembly connectors are illustrated using ball-andsocket icons. To show a required interface, use the socket icon and write the name of the
UML 2.0 in
a Nutshell
from O'Reilly
your
pain.
It'sabeen
crafted with
for professionals
interface
near
the connector
symbol.feels
Figure
5-3
shows
component
two required like
you who must read, create, and understand system artifacts expressed using UML.
interfaces.
Furthermore, it's been fully revised to cover version 2.0 of the language.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also
explains
key concepts
in a way
that appeals
to readers interfaces
already familiar with
Figure
5-3.
Component
with
two required
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
Deployment
Diagrams
Show and
a provided
interface
with the ball half of an assembly connector, again with the name of
the interface near the symbol. Figure 5-4 shows a component with a provided interface.
Extension Mechanisms
The Object Constraint Language (OCL)

Figure 5-4. Component with a provided interface


If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

To wire components together, simply connect the matching provided and required interfaces.
UML 2.0 in a Nutshell
Component dependencies
using assembly connectors provide more details about the actual
ByDan Pilone,
Neil Pitman than simple dependency relations. Figure 5-5 shows the
relationships between
components
...............................................
same three components
from the "Component Dependencies" section, but using assembly
Publisher:O'Reilly
connectors.
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Figure 5-5. Component relationships using assembly connectors


Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like

5.2.1.2.
dependencies
you whoInterface
must read,
create, and understand system artifacts expressed using UML.

Furthermore, it's been fully revised to cover version 2.0 of the language.
While assembly connectors provide more detail than simple component dependencies, they
This comprehensive
edition not
onlythe
provides
a quick-reference
to all UML
diagram
don't
provide detailednew
information
about
interface
that is being realized.
UML2.0
provides
a
types,
it also explains
key concepts
in a way that
appeals
to readers
already familiar
with
third
black-box
representation
of components
using
realization
and dependency
relationships
UML
or object-oriented
programming
to
interfaces.
If a component
provides concepts.
an interface, use a realization arrow from the
component to the interface. If the component requires an interface, use a dependency arrow
Topics
from
theinclude:
component to the required interface. Figure 5-6 shows the same three components
asFigure 5-2, but with explicit interface dependencies.
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML

Figure 5-6. Components with explicit interface dependencies


An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
An
advantage
to the
interface
dependency
stylefor
of modeling
modeling software
is that you
can attach
other
Today,
UML has
become
the standard
method
systems,
which
means
modeling
elements,
such as athis
state
or use case,
to an more
interface.
particularly
you're probably
confronting
richmachine
and expressive
language
than This
ever isbefore.
And
useful
when ayou
component
a protocolyourself,
becauseyou'll
you can
the
even though
may notimplements
write UML diagrams
still link
need
to provided
interpret interface
to
a protocol
stateby
machine
diagrams
written
others.to further clarify the component's usage (see "Protocol State
Machines" in Chapter 8).

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore,
it's beencompartments
fully revised to cover version 2.0 of the language.
5.2.1.3.
Component
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types,
it provides
also explains
key concepts
in components
a way that appeals
to readers already
familiar
UML
also
a black-box
view of
using compartments.
You may
addwith
a
UML or object-oriented
programming
concepts.
compartment
to show provided
and required
interfaces. Label provided interfaces with the
stereotypeprovidedinterfaces and required interfaces with the stereotype required
Topics include:
interfaces
.Figure 5-7 shows the AccountManagement component using compartments to
identify the provided and required interfaces.
The role an
andadditional
value of UML
in projectsstereotyped artifacts, that can show which
UML suggests
compartment,
artifacts actually implement a component (typically one or more JARs, DLLs, etc.). Figure 5-8
object-oriented
paradigm
and its relation to the UML
showsThe
a component
with an
artifact compartment.
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
Figure
5-7.Diagrams
Interface dependencies in compartment form
and
Deployment
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

Figure 5-8. A component with an artifacts compartment


UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

5.2.2. White-Box View

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even
though
you may
not about
write UML
diagrams yourself,
still need
to defines
interpreta whiteIn
order
to provide
details
the implementation
of ayou'll
component,
UML
diagrams
written
by others.
box
view. The
white-box
view shows exactly how a component realizes the interfaces it
provides. This is typically done using classes and is illustrated with a class diagram; however
2.0 in a Nutshell
from some
O'Reilly
pain. It's
for professionals like
aUML
component
may delegate
or feels
all of your
its behavior
tobeen
othercrafted
components.
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

5.2.2.1. Realization compartment

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
The simplest white-box view of a component is to add a compartment to the component and
UML or object-oriented programming concepts.
list the classifiers that realize it. The compartment should be labeled with the realizations
stereotype. While this provides more detail than a black-box view, it is of limited use to
Topics include:
component developers. Figure 5-9 shows a component with a realizations compartment.
The role and value of UML in projects

5.2.2.2. Classifier dependencies


The object-oriented paradigm and its relation to the UML
An the
integrated
approach
to UML diagrams
To show
internals
of a component,
you may show each classifier that realizes a
component with a dependency on the component itself. Note that the relationship between
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
the classifiers and the component is a dependency relationship (dashed line, open arrow), not
and Deployment Diagrams
a realization relationship. This notation is useful
Extension Mechanisms
The Object Constraint Language (OCL)

Figure 5-9. Component with a realizations compartment

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
for
identifying
which
classifiers
make upmethod
a component,
but the
focus ofsystems,
the diagram
still on
Today,
UML has
become
the standard
for modeling
software
whichismeans
the
component
a whole. Figure
5-10
shows
a white-box
viewmore
of a component
and itsAnd
you're
probablyasconfronting
this rich
and
expressive
language
than ever before.
constituent
classifiers.
even though
you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must
read,5-10.
create, White-box
and understandview
system
expressed using UML.
Figure
ofartifacts
AccountManagement
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
To shift the focus to the structure of the classifiers making up the component, you may show
the classifiers
inside
the component's rectangle. This tends to have the effect of emphasizing
Extension
Mechanisms
the relationships of the classifiers making up the component, and it encourages component
encapsulation.
Figure
5-11 shows
the detailed
The Object
Constraint
Language
(OCL) realization of a component.
If the internals of a component are sufficiently complex, it is common to use a separate class
diagram to model the details. You can link the new class diagram back to its component using
aIfnote.
you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

Figure 5-11. Detailed realization of AccountManagement

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
5.2.2.3.
Ports
and connectors
language
that applies
to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
UML
2.0UML
introduces
the concept
of portsmethod
to allow
to explicitly
identify
functionality
that is
Today,
has become
the standard
foryou
modeling
software
systems,
which means
exposed
to the outside
world.this
A port
together language
related provided
andever
required
interfaces
you're probably
confronting
rich groups
and expressive
more than
before.
And
and
uses
connectors
to not
mapwrite
them
to adiagrams
classifieryourself,
that realizes
If a port has
even
though
you may
UML
you'llthe
stillfunctionality.
need to interpret
both
provided
and by
required
diagrams
written
others.interfaces, it is called a bidirectional port . A port is shown as a
small rectangle on one of the sides of a classifier. An assembly connector (ball and socket)
indicates
provided
and from
required
interfaces.
UML 2.0 in
a Nutshell
O'Reilly
feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
In
order to show
realization
of functionality,
a connector
maps
the port to an internal
Furthermore,
it'sthe
been
fully revised
to cover version
2.0 of the
language.
classifier. A connector is shown as a solid line with a filled arrow from the port to the
classifier.
A connectornew
indicates
arriving
at the port
in the
form
This comprehensive
editionthat
not any
onlymessages
provides a
quick-reference
to(typically
all UML 2.0
diagram
of
method
calls)
are
forwarded
to
the
specified
classifier.
You
can
also
use
connectors
from
types, it also explains key concepts in a way that appeals to readers already familiar with a
classifier
to a port to show
messages being
passed through a provided interface. Figure 5-12
UML or object-oriented
programming
concepts.
shows a white-box view of a component with three ports.

Topics include:
The role5-12.
and value
of UML in projects
Figure
Component
realization with ports and connectors
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

5.2.3. Component Stereotypes

www.it-ebooks.info

UML defines several stereotypes that apply specifically to components:


UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman

Entity

...............................................
Publisher:O'Reilly
Pub Date:
June 2005 a business concept. An entity component typically passes
A component
that represents
ISBN:
0-596-00795-7
information in and out of interfaces and is often persisted as a whole. Entities don't
Pages:
234functionality, or service capabilities, associated with them; they are
typically have
any

usually just for data storage and retrieval.


Table of Contents | Index

Process
A component
fulfill
functional
requests
opposed
an entity
component). A
System
developers that
havecan
used
modeling
languages
for(as
decades
to to
specify,
visualize,
process
transaction-based
typically
has some
typeisofone
state
associated
construct,
andcomponent
document is
systems.
The Unifiedand
Modeling
Language
(UML)
of those
with itUML
(as opposed
stateless
components).
languages.
makes it to
possible
for service
team members
to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Realization
Today, UML has become the standard method for modeling software systems, which means
component
that doesn't
its own
specification.
Rather
it is
a realization
of aAnd
you'reA probably
confronting
thishave
rich and
expressive
language
more
than
ever before.
component,
shown
in Figure
5-13. you'll still need to interpret
even specification
though you may
not writeasUML
diagrams
yourself,
diagrams written by others.

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like

Figure
5-13.
A specification
component
associated
with
a UML.
realization
you who must
read,
create, and understand
system artifacts
expressed
using
component
Furthermore, it's been fully revised to cover
version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Service
Extension Mechanisms
A stateless component that can fulfill functional requests. Service components are
The Object Constraint Language (OCL)
rarely persisted because they contain no state.

Specification
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.
A component that has provided and required interfaces but no implementation
(realizing classifiers). A specification component, shown in Figure 5-13, should be
paired with a realization component or implement component.

Subsystem

www.it-ebooks.info

A larger component that makes up part of a bigger software system. UML provides no
real definition for a subsystem; however, subsystem generally means a self-contained
set of functionality
is larger than a simple component.
UML 2.0 in athat
Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

Chapter 6. Deployment Diagrams

...............................................
Publisher:O'Reilly
Pub Date: June 2005
Deployment diagrams
model the mapping of software pieces of a system to the hardware that
ISBN:0-596-00795-7
is going to execute
it.
Software
elements (components, classes, etc.) are typically manifested
Pages:234

usingartifacts and are mapped to the hardware or software environment that will host them,
callednodes . Because many nodes may be associated with the deployment of a system,
communication
between nodes can be modeled using communication paths .
Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
6.1. Artifacts
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
0-596-00795-7
Artifacts represent
physical
pieces of information related to the software development
Pages:234
process. For example,
you can use an artifact to represent a DLL needed by your system, a

user's manual, or an executable produced when your software is compiled.


Table of Contents
| Indexare used to represent the compiled version of a component (see Chapter
Typically
artifacts
5); however, UML 2.0 allows artifacts to represent any packageable element, which includes
just about everything in UML. You show an artifact using the classifier rectangle with a dogeared
paper
in the upper
Figure 6-1languages
shows a basic
artifact.to specify, visualize,
System
developers
have right.
used modeling
for decades
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
6-1.
A simplelanguage.
artifact
communicate solutions in a Figure
consistent,
tool-supported

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
UML
allows
artifacts
to key
haveconcepts
properties
and
operations
thatto
manipulate
the artifact.
These
types,
it also
explains
in a
way
that appeals
readers already
familiar
with are
most
used when
an artifact concepts.
represents a set of configurable options. For example,
UML commonly
or object-oriented
programming
deployment specifications , which represent configuration settings for deployed artifacts,
frequently
use attributes to represent the allowed settings (see "Deployment Specifications").
Topics include:
Figure 6-2 shows an artifact with attributes.
The role and value of UML in projects
The object-oriented
paradigm
relation to
the UML
Figure
6-2.and
Anits
artifact
with
attributes
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

6.1.1. Artifact Instances


Like nearly all other UML classifiers, artifacts are really types . This means that technically a
physical DLL on a node is an instance of an artifact. For example, you can have an artifact

www.it-ebooks.info

namedlogging.jar that represents your logging framework implementation. However, you


may have several web applications installed on a server, each with their own copy of
logging.jar. Each physical copy is an instance of the original artifact.
UML 2.0 in a Nutshell

You show an instance


of an
artifact
ByDan Pilone,
Neil
Pitman by underlining the name of the artifact. Figure 6-3 shows
an instance of the
logging.jar artifact.
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
Figure
6-3. An instance

of the logging.jar artifact

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML
thewhether
standardanmethod
modeling to
software
systems,
which means
Typically
you has
can become
determine
artifactfor
is intended
be a type
or an instance
based
you're
probably
confronting
rich and
expressive language
more than
before.
And
on
context,
so UML
allows thethis
normal
(nonunderlined)
representation
of anever
artifact
to be
even though
may not of
write
diagrams
need to speaking,
interpret this
interpreted
asyou
an instance
thatUML
artifact
if the yourself,
context isyou'll
clear.still
Practically
diagrams into
written
bymodels
others.using artifacts as instances, but not underlining the title.
translates
most
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
6.1.2.
Manifestations
Furthermore, it's been fully revised to cover version 2.0 of the language.
An
artifact
is a manifestation
of another
UML
element.
For example, logging.jar
may
be a
This
comprehensive
new edition
not only
provides
a quick-reference
to all UML 2.0
diagram
manifestation
of
the
LoggingSubsystem
component.
You
capture
the
manifestation
relationship
types, it also explains key concepts in a way that appeals to readers already familiar with
with
line from the
artifact to the
element it represents, and label the line with the
UMLaordashed
object-oriented
programming
concepts.
keywordmanifest.Figure 6-4 shows the LoggingSubsystem manifestation.
Topics include:

The 6-4.
role and
value of UML
projects
Figure
Showing
theinmanifestation
of a component as an artifact
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.
In UML 1.x, manifestations were known as implementations . In UML 2.0 it was decided that
implement had been overused, so it has been deprecated in favor of the keyword manifest.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
6.2. Nodes
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:entity
0-596-00795-7
A node is a physical
that can execute artifacts. Nodes can vary in size from a simple
Pages:
embedded device
to a234
server farm. Nodes are a critical piece of any deployment diagram

because they show where a particular piece of code executes and how the various pieces of
the system (at the execution level) communicate.
Table of Contents | Index

You show a node as a 3D box with the name of the node written inside. However, possibly
more than any other classifier in UML, modelers typically use specific icon representations of
nodes
to developers
help conveyhave
the type
hardware
represented.
Figure 6-5
shows avisualize,
simple node as a
System
used of
modeling
languages
for decades
to specify,
cube,
as
well
as
example
icon
representations.
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Figure 6-5. Several nodes using the cube representation, and some
Today, UML has become the
standard method
for modeling software systems, which means
example
icon representations
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML

Previous
of approach
UML did not
define
any specializations of a node. UML 2.0 specializes a
An versions
integrated
to UML
diagrams
node into two different aspects of hosting code: the required software and the required
hardware
. Therefore,
it is
less
common
to seeCollaboration,
a generic nodeStatechart,
in UML 2.0Activity,
diagrams
than it was
Class
and Object,
Use
Case,
Sequence,
Component,
in UMLand
1.x.Deployment
See "Execution
Environments" and "Devices" for more information.
Diagrams

Extension Mechanisms

6.2.1.The
Execution
Environments
Object Constraint Language (OCL)
Anexecution environment is a specialized node that represents a software configuration
hosting
specific
An execution
environment
is expected
to provide
specific
If you're
new totypes
UML,of
a artifacts.
tutorial with
realistic examples
has even
been included
to help
you
services
to hosted artifacts
means
of mutually agreed upon interfaces. For example, a Java
quickly familiarize
yourself by
with
the system.
2 Enterprise Edition (J2EE) application expects to run in a software environment called an
Application Server. The J2EE specification enumerates several services that should be
provided by an Application Server, such as database connectivity, lifecycle contracts, and
resource location. You can express that a node is an Application Server (and therefore
provides the required services) by defining a stereotype for the node. For example, a typical

www.it-ebooks.info

stereotype for an Application Server is J2EE Container.Figure 6-6 shows an Application


Server execution environment.
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Figure 6-6. A J2EE execution
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

environment

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages.
UMLhow
makes
it possible
for team
toenvironment
collaborate by
a common
You
can specify
services
provided
by themembers
execution
areproviding
configured
using
language
that
applies
to
a
multitude
of
different
systems.
Essentially,
it
enables
you
to
configuration files or deployment specifications (see "Deployment Specifications").
communicate solutions in a consistent, tool-supported language.
An execution environment is technically a node by itself but is typically shown as part of
Today, UML
has become the
standard
methoda for
modeling
software
systems,
whichon
means
another,
hardware-based
node.
For example,
J2EE
Container
may itself
be hosted
a
you're probably
confronting. You
this can
rich show
and expressive
language
morebythan
ever before.
machine
named AppServer1
the hosting
relationship
embedding
the And
even though
you may not
write
UML diagrams
still need to
interpret
execution
environment
in the
hardware
node, oryourself,
by usingyou'll
a composition
arrow.
Figure 6-7
diagrams
by others.
shows
bothwritten
representations.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore,
it's Two
been fully
revised to cover version
of the language.
Figure 6-7.
representations
of an2.0
execution
environment in a

node

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,

6.2.1.1.
environment
stereotypes
andExecution
Deployment
Diagrams

Extension
Mechanisms
The UML
specification
intends for people to create UML 2.0 Profiles that define unique
execution environments and their required deployment specifications. These unique
The Object
environments
are Constraint
each givenLanguage
their own(OCL)
stereotype and are applied to nodes when
appropriate. For example, the UML specification suggests stereotypes such as OS,database
system, and J2EE Container.
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

6.2.1.2. Explicit services

Usually, any services offered by the execution environment are implicit in the stereotype
used. However, you may explicitly show the services if that increases the readability of your

www.it-ebooks.info

model. The specification doesn't state how to represent explicit services but suggests listing
them in a compartment within the execution environment. Figure 6-8 shows an example
execution environment with an explicit list of the services offered.
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
O'Reilly
Figure Publisher:
6-8. An
execution environment with explicit services
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like

6.2.2.
Devices
you who
must read, create, and understand system artifacts expressed using UML.

Furthermore, it's been fully revised to cover version 2.0 of the language.
Adevice is a specialization of a node that represents a physical machine capable of
This comprehensive
newThere
edition
provides
a quick-reference
to all UML
2.0 diagram
performing
calculations.
arenot
noonly
implied
size restrictions
on a device;
a device
can be an
types, it also
explains
a way
that appeals
to readers
already familiar with
embedded
controller
orkey
the concepts
hardwareinthe
controller
is installed
in.
UML or object-oriented programming concepts.
You show a device as a node with the stereotype device.Figure 6-9 shows a node
stereotyped
as a device.
Topics include:
The role and value of UML in projects

Figure 6-9. A node stereotyped as a device

The object-oriented paradigm and its relation to the UML


An integrated approach to UML diagrams

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

One of the more powerful features of devices is that they can be nested. For example, you
If you're
to UML,
a internal
tutorial with
realistic
examples
has controllers,
even been included
to help
can
modelnew
a server
with
devices
representing
RAID
video cards,
etc.you
A
quickly
familiarize
yourself
with
the
system.
real-world use of nested devices can be pixel and vertex shading code running on a video card
(represented as a device) while the rest of the application runs on the machine's CPU. Figure
6-10 shows an example of what this diagram might look like.

www.it-ebooks.info

Figure 6-10. A device (the video card) nested inside another device
(the desktop machine)
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
6.2.3.
Communication Paths
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Communication paths represent generic communication between nodes. For example, a
router
requests
to a web
serverfor
that
uses a proprietary
socket connection
to a
Today,may
UMLpass
has HTTP
become
the standard
method
modeling
software systems,
which means
database.
Assuming
the database
is hosted
on its ownlanguage
machine,more
you than
can model
the
you're probably
confronting
this rich
and expressive
ever before.
And
deployment
themay
system
nodes
via communication
Theto
concept
of links
even thoughofyou
not as
write
UMLlinked
diagrams
yourself, you'll paths.
still need
interpret
between
nodes
existed
prior
to
UML
2.0,
however
now
the
specification
formally
names
them.
diagrams written by others.
You show a communication path as a solid line drawn from one node to another. You typically
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
don't show any directionality on the line because the communication is assumed to be
you who must read, create, and understand system artifacts expressed using UML.
bidirectional.Figure 6-11 shows an example web server configuration with several nodes
Furthermore, it's been fully revised to cover version 2.0 of the language.
communicating over communication paths.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

Figure 6-11. Several nodes linked with communication paths

Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly
familiarize
the system.
UML
doesn't
specifyyourself
a way ofwith
modeling
the actual messages passed between nodes. However,
protocol state machines (see Chapter 8) often provide a good way to represent information
flow if a particular protocol is spoken between nodes. If a link represents messages between
components that aren't captured in a protocol state machine, it may make sense to link to
one or more component diagrams (see Chapter 5) using a note. Figure 6-12 shows an
example communication path linked to a component diagram.

www.it-ebooks.info

Figure
6-12.
A communication path with a note attached
UML
2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
6.3. Deployment
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:aspect
0-596-00795-7
The most important
of deployment diagrams is conveying the relationship between
234 they execute on. When you associate an artifact with a deployment
artifacts and thePages:
node(s)

target (anything that can host an artifact, such as a device or execution environment), you
deploy that artifact. For example, you may have an artifact named ccvalidator.jar that
Table of Contents
| Index
represents
the
credit card validation subsystem of an application. When you say
ccvalidator.jar executes on the node Appserver1, you have deployed the artifact.

System developers have used modeling languages for decades to specify, visualize,
construct,
and documentRepresentation
systems. The Unified Modeling Language (UML) is one of those
6.3.1.
Deployment
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
UML
provides several
ways
show deployment.
You may
show artifact deployment by simply
communicate
solutions
in atoconsistent,
tool-supported
language.
drawing an artifact in the hosting node's cube. Figure 6-13 shows an artifact named
ccvalidator.jar
to the
devicemethod
Appserver1
.
Today, UML has deployed
become the
standard
for modeling
software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
UML also allows you to show deployment using a dashed line with an open arrow
even though you may not write UML diagrams yourself, you'll still need to interpret
(dependency) pointing from the artifact to the deployment target. You should stereotype this
diagrams written by others.
line with the keyword deploy.Figure 6-14 shows the same deployment relationship as
Figure 6-13, but uses the dependency notation.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who
must
and understand
artifacts artifacts
expressed
UML.
Finally,
you
mayread,
showcreate,
deployment
by simply system
listing deployed
in using
a compartment
in
Furthermore,
it's
been
fully
revised
to
cover
version
2.0
of
the
language.
the deployment target's classifier. This notation is particularly useful if you have a lot of
artifacts deployed to a single node. Figure 6-15 shows an execution environment with several
This comprehensive
deployed
artifacts. new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

Topics include:

Figure 6-13. An artifact deployed to a device

The role and value of UML in projects


The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

Figure 6-14. Artifact deployment using a dependency relationship


If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Figure 6-15. An execution environment with a list of the deployed


artifacts

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 introduced the term deployed artifact for artifacts that have been associated with
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
nodes. There is no new notation; UML 2.0 just added a formal recognition of the concept.
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

6.3.2.
Deployment
This comprehensive
newSpecifications
edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Adeployment specification is a collection of properties that specify how an artifact is to be
Topics include:
deployed
on a deployment target. For example, you can specify that an artifact requires
database transactions or connection information to communicate with a server. You model the
specific deployment information as a deployment specification artifact.
The role and value of UML in projects
You show a deployment specification using the classifier rectangle stereotyped as deployment
paradigm
and its relation
to the UML
spec,The
withobject-oriented
required deployment
information
as attributes.
Figure 6-16 shows an example
deployment specification captured in a file named web.xml .
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams

Figure 6-16. A sample deployment specification

Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

The specific information in a deployment specification depends on the type of artifact being
deployed. You may need a separate model to capture the type of information used by the

www.it-ebooks.info

specification. For example, Figure 6-16 uses a type named Resource that should be defined on
another diagram.
2.0 inan
a Nutshell
It's common to UML
bundle
artifact and its deployment specification into a larger artifact. You
show the relationship
between
an artifact and its deployment specification using a dashed line
ByDan Pilone,
Neil Pitman
with an open arrow
(dependency) pointing from the specification to the artifact. Figure 6-17
...............................................
shows bundling Publisher:
the weatherserver.jar
application with its deployment descriptor in a web
O'Reilly
Pub Date: June 2005
archive called weatherserver.war
.
ISBN:0-596-00795-7
Pages:234

Figure 6-17. An artifact that contains another artifact and its


deployment specification

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
6.4. Variations
on Deployment Diagrams
...............................................
Publisher:O'Reilly
Pub Date: June 2005
0-596-00795-7
Most of the timeISBN:
deployment
diagrams are used for their intended purpose: to show how an
Pages:234
application is physically
deployed. Some modelers prefer to display the bare minimum, just

showing how many machines they will need and how they are supposed to talk. Modelers
often take liberties with the official notation and will specify minimum requirements for their
Table of Contents
Index
machines,
as |in
Figure 6-18.

System developers have used modeling languages for decades to specify, visualize,
construct, and document
Unified Modeling
Languagediagram
(UML) is one of those
Figure systems.
6-18. AThe
minimal
deployment
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore,
it's6-18
been
fully revised
cover
version 2.0
the language.
Obviously
Figure
doesn't
providetoany
information
on of
actual
software deployment.
Instead of focusing on the node's configuration, you can focus on the software deployment
This comprehensive
new details
edition for
notexecuting
only provides
quick-reference
to in
allFigure
UML 2.0
diagram
configuration
and specify
your asoftware,
as shown
6-19.
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
Figure

6-19. Detailed application deployment diagram

The role and value of UML in projects


The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)
For the sake of completeness, we should mention that deployment diagrams have been used
to
Properties
and
tagged values
canbeen
be used
to show
network
If show
you'renetwork
new to configurations.
UML, a tutorial with
realistic
examples
has even
included
to help
you
configuration
options
rather with
thanthe
machine
hardware details. Figure 6-20 shows an example
quickly familiarize
yourself
system.
network modeled as a deployment diagram. Be warned, though: deployment diagrams were
not designed with network modeling in mind, so a professional network administrator may
find the syntax lacking.

www.it-ebooks.info

Figure 6-20. A sample network topology using a deployment


diagram
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

Chapter 7. Use Case Diagrams

...............................................
Publisher:O'Reilly
Pub Date: June 2005
Use cases are aISBN:
way 0-596-00795-7
to capture system functionality and requirements in UML. Use case
diagrams consist
of
named
pieces of functionality (use cases ), the persons or things invoking
Pages:234

the functionality (actors ), and possibly the elements responsible for implementing the use
cases (subjects ).
Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
7.1. Use Cases
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Use cases represent
distinct pieces of functionality for a system, a component, or even a
234 have a name that is typically a few words describing the required
class. Each use Pages:
case must

functionality, such as View Error Log. UML provides two ways to draw a use case. The first is
an oval with the name of the use case in the center. Figure 7-1 shows a basic use case.
Table of Contents | Index

System developers have used


modeling
for decades
to specify, visualize,
Figure
7-1.languages
A simple
use case
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
youcan
whodivide
must aread,
create,oval
andinto
understand
systemtoartifacts
using
UML.
You
use case's
compartments
provideexpressed
more detail
about
the use
Furthermore,
it's been fully
revised
to cover
2.0 of included
the language.
case,
such as extension
points
(see "Use
Caseversion
Extension"),
use cases (see "Use Case
Inclusion"), or the modeling of specific constraints. Figure 7-2 shows a use case oval with a
This comprehensive
new edition
not only provides a quick-reference to all UML 2.0 diagram
compartment
listing extension
points.
types, it also explains key concepts in a way that appeals to readers already familiar with
However,
the oval representation
of use
cases doesn't hold up well with detailed
UML or object-oriented
programming
concepts.
compartments. UML recommends you use the classifier notation if you want to provide details
about
use case. Show the use case as a rectangle, with the use case oval in the top-right
Topicsa include:
corner. Now, place the name of the use case in the top, in bold. You can then divide the
classifier into compartments as needed. Typical
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML

Figure
7-2. Use case with a compartment showing extension points
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize
yourself
with thepoints
system.
compartment
names
are extension
and included use cases.Figure 7-3 shows the
same use case as in Figure 7-2, but in classifier notation.

Figure 7-3. Use case in classifier notation

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

UML makes a clear distinction that the term use case strictly applies to the UML element and
Tablename.
of Contents
Index
its
Full| documentation
of a use case is considered an instantiation of the use case. This
is a subtle distinction, but it allows you to document a use case whatever way best captures
the use case's functionality. You can document a use case in a text document, state machine,
interaction
diagram, have
activity
diagram,
or languages
anything else
conveys
the details
of the
System developers
used
modeling
for that
decades
to specify,
visualize,
functionality
in
a
meaningful
way
to
your
reader.
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
7.2. Actors
...............................................
Publisher:O'Reilly
Pub Date: June 2005
0-596-00795-7
A use case mustISBN:
be initiated
by someone or something outside the scope of the use case. This
234 an actor . An actor doesn't need to be a human user; any external
interested partyPages:
is called

system or element outside of the use case may trigger the use case (or be the recipient of use
case results) and should be modeled as an actor. For example, it is very common to model
Table system
of Contentsclock
| Index
the
as an actor that triggers a use case at a given time or interval.
An actor can have several different representations in UML. The first is a stick figure with the
name
of the
actor written
near modeling
the icon (usually
right
it). Figure
7-4 shows
an actor
System
developers
have used
languages
forbelow
decades
to specify,
visualize,
icon.
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
Alternatively,
actor can
shown using
the classifier
notation.
You represent
language thatan
applies
to a be
multitude
of different
systems.
Essentially,
it enables the
youactor
to with
acommunicate
rectangle, with
the
keyword
actor
at
the
top
and
the
name
of
the
actor
in
bold
immediately
solutions in a consistent, tool-supported language.
below that. Because actors don't typically have compartments, this representation isn't used
very
often.
7-5 shows
actor in
classifier
Today,
UMLFigure
has become
the an
standard
method
for notation.
modeling software systems, which means

you're probably confronting this rich and expressive language more than ever before. And
If it is helpful, you may use custom icons to clearly distinguish different types of actors. For
even though you may not write UML diagrams yourself, you'll still need to interpret
example, you can show an external database system using a database
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Figure
An actor
stick
representation
Furthermore,
it's 7-4.
been fully
revised using
to coverthe
version
2.0 figure
of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams

Figure 7-5. An actor using classifier notation

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.
icon while showing the system administrator as a stick figure. Figure 7-6 shows exactly this
set of actors.

www.it-ebooks.info

Figure 7-6. Actor with a custom icon


UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

7.2.1. Actor/Use Case Associations


System developers have used modeling languages for decades to specify, visualize,
construct,
and
document
systems.
Modeling
Language
(UML) isbetween
one of those
You
typically
associate
an actor
withThe
oneUnified
or more
use cases.
A relationship
an actor
languages.
UMLindicates
makes itthe
possible
for teamthe
members
to collaborate
providing
common
and
a use case
actor initiates
use case,
the use casebyprovides
thea actor
with
language
to a an
multitude
of different
it enables
you line.
to
results,
or that
both.applies
You show
association
betweensystems.
an actorEssentially,
and a use case
as a solid
communicate solutions
a consistent,
tool-supported
Conventionally
you read in
use
case diagrams
from left to language.
right, with actors initiating use cases
on the left and actors that receive use case results on the right. However, depending on the
Today,orUML
has
the it
standard
method
fortomodeling
software
systems,
which
means
model
level
of become
complexity,
may make
sense
group actors
differently.
Figure
7-7
shows
you're
confronting
rich
and expressive language more than ever before. And
an
actorprobably
communicating
withthis
a use
case.
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0
in a Nutshell
O'Reillyassociated
feels your pain.
been
craftedItem
for professionals
Figure
7-7. from
An actor
toIt's
the
Order
use caselike
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
Though
notobject-oriented
part of the official
UML specification,
it istocommon
The
paradigm
and its relation
the UMLto see directional arrows on
association lines to indicate who initiates communication with whom. Note that the arrows
don't necessarily
restrict
the direction
of information flow; they simply point from the initiator
An integrated
approach
to UML diagrams
to the receiver of the communication. What happens after a use case begins execution is
Class
and Object,
Case,
Sequence,
Collaboration,
Component,
specified
elsewhere
(seeUse
"Use
Cases").
Figure 7-8
shows two Statechart,
actors and aActivity,
use case
with
and Deployment
directional
associations.Diagrams

Extension Mechanisms
The 7-8.
ObjectAn
Constraint
Language
(OCL)
Figure
example
of directed
associations between actors and
a use case
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

7.2.2. System Boundaries


System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
By
definition,UML
usemakes
cases capture
thefor
functionality
of a particular
subject.
Anything anot
realized
languages.
it possible
team members
to collaborate
by providing
common
by
the subject
considered
outside the
system boundaries
and shoulditbe
modeled
astoan
language
that is
applies
to a multitude
of different
systems. Essentially,
enables
you
actor.
This technique
is very
useful in determining
the scope
and assignment of
communicate
solutions
in a consistent,
tool-supported
language.
responsibilities when designing a system, subsystem, or component. For example, if while you
are
modeling
an ATM
system,
your design
discussions
digress
into discussions
the details
Today,
UML has
become
the standard
method
for modeling
software
systems,of
which
means of
the
back-end
banking
system,
a use
model with language
clearly defined
system
boundaries
would
you're
probably
confronting
this
richcase
and expressive
more than
ever
before. And
identify
the banking
system
as anUML
actor
and therefore
outside
of the
problem.
even though
you may
not write
diagrams
yourself,
you'll the
stillscope
need to
interpret
diagrams written by others.
You represent system boundaries in a generic sense using a simple rectangle, with the name
of
the2.0
system
at the top.
Figure
7-9 feels
shows
the pain.
system
for for
theprofessionals
ATM machinelike
UML
in a Nutshell
from
O'Reilly
your
It'sboundaries
been crafted
mentioned
in the
previous
paragraph.
you who must
read,
create,
and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive
new edition
not onlyFunctionality
provides a quick-reference to all UML 2.0 diagram
7.2.3.
Using Actors
to Identify
types, it also explains key concepts in a way that appeals to readers already familiar with
UML ordon't
object-oriented
programming
Actors
need to have
a one-to-oneconcepts.
mapping to physical entities; in fact, they don't need
to be physical entities at all. UML allows for actors to represent roles of potential users of a
Topics include:
system.
For example, the system administrator may be the only physical user of a system,
but that administrator may wear many hats. It may be helpful to view the system from the
perspective
of a
database
backup administrator, deployment administrator,
The role
and
value ofadministrator,
UML in projects
and so on. By specifically identifying the various roles of actors that may use the system, you
can often
use cases
that would
gone unnoticed.
The discover
object-oriented
paradigm
and have
its relation
to the UMLFigure 7-10 shows a sample
diagram containing three types of administrators and example use cases.
An integrated approach to UML diagrams

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and7-9.
Deployment
Figure
A useDiagrams
case diagram showing the system boundaries of an
ATM System
Extension Mechanisms

The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams
written by
Figure 7-10.
Anothers.
example of using specialized versions of an actor to

help find required functionality


UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
7.3. Advanced
Use Case Modeling
...............................................
Publisher:O'Reilly
Pub Date:
June 2005
As it does for other
classifiers,
UML provides mechanisms for reusing and adding on to use
ISBN:
0-596-00795-7
cases and actors.
You
can expand an actor's capabilities or replace entire use cases using
Pages:
234
generalization . You
can
factor out common elements of use cases using included use cases, or
add on to base use cases using use caseextension .
Table of Contents | Index

7.3.1. Actor and Use Case Generalization


System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
Though
not officially
mentioned
in the
actors
and use cases
can be generalized
languages.
UML makes
it possible
for specification,
team members
to collaborate
by providing
a common
like
many
other
classifiers.
Actor
generalization
is
typically
used
to
pull
out
common
language that applies to a multitude of different systems. Essentially, it enables
you to
requirements
several
actors
to simplify modeling.
communicatefrom
solutions
in adifferent
consistent,
tool-supported
language.For example, Figure 7-10
shows several administrators and the use cases they need to invoke. You may have a
Database
Administrator
, athe
Backup
Administrator
a Deployment
, allmeans
with
Today, UML
has become
standard
method for, and
modeling
softwareAdministrator
systems, which
slightly
different needs.
However,
the and
majority
of the language
needs of the
individual
actors
may
you're probably
confronting
this rich
expressive
more
than ever
before.
And
overlap.
You can
out write
a generic
Administrator
actor
capture
the common
even though
youfactor
may not
UML System
diagrams
yourself, you'll
stilltoneed
to interpret
functionality,
and
then
specialize
to
identify
the
unique
needs
of
each
actor.
diagrams written by others.
You represent actor generalization like any other classifier; draw a solid line, with a closed
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
arrow pointing from the specialized actor to the base actor. Figure 7-11 shows the same
you who must read, create, and understand system artifacts expressed using UML.
information as Figure 7-10 but in a much easier-to-read diagram.
Furthermore, it's been fully revised to cover version 2.0 of the language.
Use cases may be generalized as well. Typically use case generalization is used to express
This comprehensive
new edition
not
only provides
quick-reference
to all
UML 2.0 diagram
some
high-level functional
need of
a system
withouta going
into specifics.
Specializations
of a
types,
it
also
explains
key
concepts
in
a
way
that
appeals
to
readers
already
familiar
general use case introduce specific functionality. For example, a generic use case
can with
be
UML or object-oriented programming concepts.
Verify Passenger Identity, and specializations of that use case can be Check Passenger
Fingerprint and Verify Passenger's RFID Tag. It is important to notice that even with use
Topics
include:
case
generalization,
you should still discuss functionality, not implementation. You should not
have specializations of a use case for different ways to implement the same functionality , only
to represent
different
functionality
The role
and value
of UML in. projects
You represent
use case generalization
just
you do
generalization: using a solid line,
The object-oriented
paradigm and
itslike
relation
to actor
the UML
with a closed arrow pointing from the specialized use case to the base use case. If the general
use case
abstract functionality
(meaning it's a functional concept but doesn't
An represents
integrated approach
to UML diagrams
actually explain how a user would do something), you show the name of the use case in
italics.Class
Figureand
7-12
showsUse
theCase,
verification
use cases
and theirStatechart,
relationships.
Object,
Sequence,
Collaboration,
Activity, Component,
and Deployment Diagrams

Mechanisms
7.3.2.Extension
Use Case
Inclusion
The Object Constraint Language (OCL)
You can factor out common functionality from several use cases by creating a shared,
included use case. Unlike in use case extension (discussed next), the use case that includes
another use case is typically not complete on its own. The included functionality isn't
If you're new
to UML,
examples
even
to help you
considered
optional;
it a
is tutorial
factoredwith
out realistic
simply to
allow forhas
reuse
in been
other included
use cases.
quickly familiarize yourself with the system.
You show use case inclusion using a dashed line, with an open arrow (dependency) pointing
from the base use case to the included use case. Label the line with the keyword include.
Figure 7-13 shows an example of use case inclusion.

www.it-ebooks.info

Figure 7-11. Actor generalization, in which the System Administrator


is the generic base actor and the lower three are specializations
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value
of UML7-12.
in projects
Figure
Use

case generalization

The object-oriented paradigm and its relation to the UML


An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

Include or UML
Includes?
2.0 in a Nutshell
ByDan Pilone,Neil Pitman

Often there is disagreement


between UML modelers as to whether the proper
...............................................
keywords are include
and
extend
or includes and extends. One would think the
Publisher:O'Reilly
UML specification
put this
Pub would
Date: June
2005to rest. However, as of the UML 2.0 specification,
the use case section
states that the keywords are include and extend, and then
ISBN:0-596-00795-7
Pages:
234
proceeds to show
examples
using includes and extends! We think it's safe to say,
that either is acceptable.
Table of Contents | Index

Figure
7-13.
Use case
inclusion
System developers have used
modeling
languages
for decades
to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:

7.3.3. Use Case Extension


The role and value of UML in projects
The object-oriented
and its relation
to the to
UML
UML provides
the ability toparadigm
plug in additional
functionality
a base use case if specified
conditions are met. For example, if you are modeling a banking application, you can have a
An named
integrated
approach to UML diagrams
use case
Open Account that specifies how the user can create a new account with the
bank. You can offer a joint account that allowed a user to add other people to his account.
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
The joint account functionality can be captured with a different, use case named Add Joint
and Deployment Diagrams
Member. In this case the specified condition for the extension is more than one member on the
bank application.
Extension Mechanisms
UML clearly
specifies
that a base
use case
should be a complete use case on its own. The
The Object
Constraint
Language
(OCL)
extension use cases are typically smaller in scope and represent additional functionality, so
they may not be useful outside the context of the base use case.
Any
use case
wantatotutorial
extendwith
must
have clearly
defined
. Antoextension
If you're
newyou
to UML,
realistic
examples
has extension
even beenpoints
included
help you
point
is afamiliarize
specification
of some
in the use case where an extension use case can plug in
quickly
yourself
withpoint
the system.
and add functionality. UML doesn't have a particular syntax for extension points; they are
typically freeform text, or step numbers if the use case functionality is represented as a
numbered list.
You list extension points in a use case oval, or in a separate compartment when using the
classifier notation. Figure 7-14 shows a use case with extension points.

www.it-ebooks.info

2.0 inOval
a Nutshell
Figure UML
7-14.
and classifier notation for a use case with
ByDan Pilone,Neil Pitman extension points
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct,
andadocument
systems. The
Unified Modeling
(UML)
is arrow
one of those
You
represent
use case extension
by showing
a dashed Language
line, with an
open
languages. UML
makesfrom
it possible
for teamuse
members
by providing
a common
(dependency)
pointing
the extension
case to to
thecollaborate
base use case.
Label the
line with
language
that
applies
to
a
multitude
of
different
systems.
Essentially,
it
enables
you
to
the keyword extend.Figure 7-15 shows an example of use case extension.
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
Figure 7-15. Use case extension
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
To provide more detail you can specify where the new functionality plugs into the base use
The
role and an
value
of UML point
in projects
case by
specifying
extension
and a note attached to the dependency line. Optionally
you can specify under what condition the extension executes, such as applicants > 1.Figure
The object-oriented paradigm and its relation to the UML
7-16 shows use case extension with a note specifying the extension point and the condition to
execute
extra functionality.
Anthe
integrated
approach to UML diagrams

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams

Figure 7-16. Use case extension showing conditions in a note


Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

When the system encounters an extension point in a use case, any conditions associated with
extension use cases are evaluated. If a condition is met, the corresponding extension
functionality is executed. Once all appropriate extension use cases have been executed, the
UML 2.0 in awith
Nutshell
base use case continues
the next step in the original flow.
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
7.4. Use Case
Scope
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
As mentioned previously,
a use case is a distinct piece of functionality, meaning it is of
Pages:that
234 the user has accomplished his desired goal. Proper scoping of use
sufficient granularity

cases is an art, but UML sets several requirements to make the job a little easier:
Table of Contents | Index

A use case must be initiated by an actor.


When a use case is considered complete, there are no further inputs or outputs; the
System developers have used modeling languages for decades to specify, visualize,
desired functionality has been performed, or an error has occurred.
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
After a use case has completed, the system is in a state where the use case can be
language that applies to a multitude of different systems. Essentially, it enables you to
started again, or the system is in an error state.
communicate solutions in a consistent, tool-supported language.
One popular rule of thumb is to ask yourself if the user can "go to lunch" after completing the
Today,
UML
has become
standard
method
software
which
use
case,
meaning
that a the
reasonably
sized
goal for
hasmodeling
been achieved
by systems,
the initiator.
Formeans
you're probably
thiscart
rich is
and
expressive
language
before.
And
example,
Add itemconfronting
to shopping
probably
not the
larger more
goal athan
userever
intends;
Purchase
even
though
you
may
not
write
UML
diagrams
yourself,
you'll
still
need
to
interpret
item is likely a better scope.Purchase item can consist of adding an item to a shopping cart
diagrams
written
by others.
but
typically
has more
functionality such as logging on, entering billing and shipping
information, and confirming the order.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who
read, are
create,
and understand
systemfunctionality,
artifacts expressed
Above
all,must
use cases
intended
to convey desired
so the using
exact UML.
scope of a use
Furthermore,
it's
been
fully
revised
to
cover
version
2.0
of
the
language.
case may vary depending on the intended audience and purpose for modeling.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

Chapter 8. Statechart Diagrams

...............................................
Publisher:O'Reilly
Pub Date: June 2005
State machine diagrams
capture the behavior of a software system. State machines can be
ISBN:0-596-00795-7
used to model the
behavior
of a class, subsystem, or entire application. They also provide an
Pages:234

excellent way of modeling communications that occur with external entities via a protocol or
event-based system.
Table of Contents | Index

UML has two types of state machines:

System developers have used modeling languages for decades to specify, visualize,
construct,state
and document
Behavioral
machines systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language
to of
a multitude
of different
Essentially,
it enables
you to
Showthat
theapplies
behavior
model elements
such systems.
as objects.
A behavioral
state machine
communicate
solutions
in aimplementation
consistent, tool-supported
language.
represents
a specific
of an element.
Today, UML has become the standard method for modeling software systems, which means
Protocol
state machines
you're probably
confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
Showwritten
the behavior
of a protocol. Protocol state machines show how participants may
diagrams
by others.
trigger changes in a protocol's state and the corresponding changes in the system (i.e.,
theinnew
state of from
the protocol).
Protocol
tied to a like
UML 2.0
a Nutshell
O'Reilly feels
yourstate
pain.machines
It's been aren't
craftedtypically
for professionals
particular
implementation,
they show
the required
behavior.
you who
must read,
create, and and
understand
system
artifacts protocol
expressed
using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
Behavioral and protocol state machines share common elements; however, protocol state
machines
are not tiednew
to an
implementation
and have
restrictions on their
This comprehensive
edition
not only provides
a quick-reference
to all transitions.
UML 2.0 diagram
Because
protocol
state
machines
are
a
specialization
of
behavioral
state
machines,
this
types, it also explains key concepts in a way that appeals to readers already
familiar
with
chapter
discusses behavioral
stateconcepts.
machines and other topics common to all state
UML or first
object-oriented
programming
machine diagrams; then details of protocol state machines are explained.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
8.1. Behavioral
State Machines
...............................................
Publisher:O'Reilly
Pub Date: June 2005
0-596-00795-7
State machines ISBN:
represent
the behavior of a piece of a system using graph notation. A state
Pages:
234the basic rectangle notation, with the name of the state machine
machine is shown
using

shown in the top compartment. The outside rectangle is often omitted on state machine
diagrams that show only a single state machine. The metaclass is simply state machine .
Table of Contents
| Indexa simple state machine modeling a soda machine.
Figure
8-1 shows

System developers have used modeling languages for decades to specify, visualize,
construct, and document
systems.
The Unified
Modeling
(UML) is one of those
Figure
8-1.
A basic
stateLanguage
machine
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
A stateThe
machine
is often associated
a classifier
in the
object-oriented
paradigm with
and its
relation to
the larger
UML UML modelfor example, a
class or subsystem. However, UML doesn't define a specific notation to show this relationship.
One possible
notation
is to usetoa UML
note diagrams
labeled with the name of the state machine and linked
An integrated
approach
to the classifier. Figure 8-2 shows an example that uses a note to link a state machine to a
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
classifier.
and Deployment Diagrams

Extension Mechanisms

Figure 8-2. Example of linking a state machine to a classifier


The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
You
can model
behavior
of the classifier
using
states ,pseudostates
,activities
and
construct,
and the
document
systems.
The Unified
Modeling
Language (UML)
is one, of
those
transitions
. If
a state
machine
is used
model
the behavior
of an operation
(see a
"Operations"
languages.
UML
makes
it possible
for to
team
members
to collaborate
by providing
common
in
Chapter 2),
stateto
machine
mustof
have
parameters
thatEssentially,
match the itoperation's
language
thatthe
applies
a multitude
different
systems.
enables you to
parameters.
These
can be
in any transition
or state
as needed.
communicate
solutions
in used
a consistent,
tool-supported
language.
Transitions
statesthe
occur
when method
events are
(see "Dispatch").
As themeans
state
Today, UMLbetween
has become
standard
for dispatched
modeling software
systems, which
machine
executes,
activities are
upon the transition,
entry than
into a
state,
and so
on
you're probably
confronting
this run
richbased
and expressive
language more
ever
before.
And
(see
even"Activities").
though you may not write UML diagrams yourself, you'll still need to interpret

diagrams written by others.


Each state machine has a set of connection points that define the external interface to the
state machine. These connection points must be either Entry or Exit pseudostates.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
8.2. States
...............................................
Publisher:O'Reilly
Pub Date: June 2005
0-596-00795-7
States model a ISBN:
specific
moment in the behavior of a classifier. This moment in time is defined
Pages:
234true in the classifier.
by some condition
being

States model a situation in the behavior of a classifier when an invariant condition holds true.
Table more
of Contents
| Indexa state is a "condition of being" for the state machine and, by association,
Put
simply,
the classifier that's being modeled. For example, a coffee machine could be "Grinding Beans,"
"Brewing," "Warming Coffee," "Dispensing," etc. A state can represent a static situation, such
as
"Waiting
for Username"
or a modeling
dynamic situation
where
the state
actively
processing data,
System
developers
have used
languages
for decades
to is
specify,
visualize,
such
as
"Encrypting
Message."
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
Alanguage
state is shown
as a rectangle
with rounded
corners.
The name
of the itstate
is written
that applies
to a multitude
of different
systems.
Essentially,
enables
you toinside
the
rectangle.
Figure
8-3
shows
a
simple
state.
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
Figure
8-3. A yourself,
simpleyou'll
state
even though you may not write
UML diagrams
still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
A state name may be placed outside of the rectangle in a tab notation when showing
composite or submachine states (see "Composite States" and "Submachine States"). You
roleuse
andthe
value
UML inor
projects
shouldThe
either
tab of
notation
place the name inside the state; don't do both. Figure 84 shows a state using a tab for the state name.
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams

Figure 8-4. A state with its name in a tab

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.
Within the rectangle a state can be divided into compartments as needed. UML defines the
following compartments:

www.it-ebooks.info

Name
Shows the name of the state. This should not be used if the name is placed in a tab.
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman

Internal activities...............................................
Publisher:O'Reilly

Shows a list
internal
that are performed while in the state. See "Activities"
Pubof
Date:
June activities
2005
ISBN:0-596-00795-7
for the syntax.
Pages:234

Internal transitions
Table of Contents | Index

Shows a list of internal transitions (see "Transitions") and the events that trigger them.
Write an internal transition as:

System
developers
have used )modeling
to specify, visualize,
event
( attributeList
[ guardlanguages
conditionfor
]/decades
transition
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language
thatlist,
applies
multitude
of different
systems.
Essentially,
enables
you to of
The
attribute
whichtoisaoptional,
maps
the event's
parameters
to theit given
attributes
communicate
solutions
in
a
consistent,
tool-supported
language.
the classifier. The guard condition is also optional, but, if present, must be enclosed by square
brackets.
Today, UML has become the standard method for modeling software systems, which means
you're
probably
confronting
this
rich and
expressive
morehas
than
ever before.
The
same
event may
be listed
multiple
times
as long language
as each entry
a unique
guard And
even
though
you
may
not
write
UML
diagrams
yourself,
you'll
still
need
to
interpret
condition for the transition.
diagrams written by others.
Figure 8-5 shows a state with compartments.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

Figure 8-5. A state with compartments


This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
A state can be either active or inactive . A state is considered active as soon as it is entered
because
of some
transition.
a state Collaboration,
is considered inactive
immediately
leaving
Class
and Object,
Use Similarly,
Case, Sequence,
Statechart,
Activity, after
Component,
the state.
and Deployment Diagrams
UML defines
three
types of states:
Extension
Mechanisms

The Object Constraint Language (OCL)


Simple states
Simplest
of UML,
all states,
theywith
haverealistic
no substates.
All has
the example
states
usedtosohelp
far in
this
If you're
new to
a tutorial
examples
even been
included
you
section
are simple
states.
quickly
familiarize
yourself
with the system.
Composite states
Have one or more regions for substates. A composite state with two or more regions is
calledorthogonal .

www.it-ebooks.info

Submachine states
UML 2.0 in a Nutshell

Semantically
equivalent
to composite states, submachine states have substates that are
ByDan
Pilone,Neil Pitman
contained...............................................
within a substate machine . Unlike composite states, submachine states are
intended to
group O'Reilly
states, so you can reuse them. Composite states are typically specific
Publisher:
to the current
stateJune
machine.
Pub Date:
2005
ISBN:0-596-00795-7

Composite and submachine


states are explained in more detail in the following subsections.
Pages:234

Table of Contents | Index


8.2.1.
Composite States

developers
used
modeling
languages
for Adecades
to simply
specify,
ASystem
composite
state is have
a state
with
one or more
regions.
region is
a visualize,
container for
construct, Aand
document
systems.
TheorUnified
Modeling
(UML) is
substates.
composite
state
with two
more regions
is Language
called orthogonal
. one of those
languages. UML makes it possible for team members to collaborate by providing a common
that
applies
a multitude
of different
systems.
Essentially,
it enables you to
Alanguage
composite
state
mayto
have
an additional
compartment
called
the decomposition
communicate
solutions
in
a
consistent,
tool-supported
language.
compartment. A decomposition compartment is a detailed view of the composite state where
you can show a composite state's regions, substates, and transitions. Figure 8-6 shows a
Today, UML
haswith
become
the standard
composite
state
a single
region. method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.

Figure 8-6. A composite state with one region

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

You may hide the decomposition compartment to increase the clarity of a diagram. If you hide
the compartment, you can use the composite icon to indicate that the state's decomposition
isn't shown on this diagram. Figure 8-7 shows a composite state with the decomposition
UML 2.0 in a Nutshell
compartment hidden.
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date:8-7.
June 2005
Figure
Composite
ISBN:0-596-00795-7
Pages:234

state with composite icon

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate
in a a
consistent,
tool-supported
language.
You
may place solutions
states within
region of a
composite state
to represent internal substates. A
substate that isn't contained in another state is called a direct substate , and a substate
Today, UML
has other
become
the standard
method
for modeling
software
systems,
which
contained
within
substates
(resulting
in recursive,
composite
states)
is called
anmeans
indirect
you're probably
confronting this rich and expressive language more than ever before. And
substate
.
even though you may not write UML diagrams yourself, you'll still need to interpret
written
others.
Adiagrams
composite
state by
is considered
active when the state machine is in any of the composite's
substates. When a composite state is active, the tree of active states, starting with the
UML 2.0 instate
a Nutshell
from
O'Reillydown
feelsto
your
It'ssubstate,
been crafted
for professionals
like
composite
itself and
working
thepain.
current
is called
the state
you who must
read,
create,aand
understand
system
artifacts
expressed
UML.
configuration
. For
example,
state
configuration
for Figure
8-6
could be using
DispensingFurthermore,
it's.been fully revised to cover version 2.0 of the language.
>Releasing
drink

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, itRegions
also explains key concepts in a way that appeals to readers already familiar with
8.2.1.1.
UML or object-oriented programming concepts.
Topics include:
A region is shown using a dashed line dividing the decomposition compartment. You may
name each region by writing its name within the region's area. Figure 8-8 shows a composite
state with
two regions.
The role
and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated
approach
diagrams
Figure
8-8.toAUML
composite

state with two regions

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate
solutions
in a consistent,
tool-supported
language.and a final state. A transition
Each
region has
its own initial
pseudostate
(see "Pseudostates")
to a composite state is a transition to the initial pseudostate in each region. Each region
Today,a UML
has become
the standard
methodand
foritmodeling
software
systems,
which
means
within
composite
state executes
in parallel,
is perfectly
acceptable
for one
region
to
you'rebefore
probably
confronting
this rich
andfinal
expressive
more than
ever before.
finish
another.
A transition
to the
state oflanguage
a region indicates
completing
theAnd
even though
you
may not
write
UML diagrams
yourself, you'll
still need state
to interpret
activity
for that
region.
Once
all regions
have completed,
the composite
triggers a
diagrams written
by others.
completion
event and
a completion transition (if one exists) triggers.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
8.2.2.
Submachine States
Furthermore, it's been fully revised to cover version 2.0 of the language.
Submachine
states are
semantically
to composite
states into
that
up
This comprehensive
new
edition notequivalent
only provides
a quick-reference
all they
UML are
2.0 made
diagram
of
internal
substates
and
transitions.
UML
defines
a
submachine
state
as
a
way
to
encapsulate
types, it also explains key concepts in a way that appeals to readers already familiar with
states
and
transitions soprogramming
that they can concepts.
be reused. A submachine state simply means that
UML or
object-oriented
another state machine, a submachine state machine, is contained by the state. For example,
the
process
of establishing a TCP/IP connection can be encapsulated into its own state
Topics
include:
machine, and that state machine can then be embedded as the first submachine state of a
state machine modeling a web page request.
The role and value of UML in projects
A submachine state is shown in the same rounded rectangle as any other state, except you
show the
of the state,
followedand
by its
a colon
(:),to
followed
by the name of the referenced
Thename
object-oriented
paradigm
relation
the UML
submachine.Figure 8-9 shows a submachine state.
An integrated approach to UML diagrams

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and8-9.
Deployment
Diagrams
Figure
A submachine
state referencing the credit card validation
state machine
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

Typically when showing a submachine state you show the entry and exit points of the

www.it-ebooks.info

referenced submachine. You show these points as pseudostates on the border of the
submachine state (see "Pseudostates").Figure 8-10 shows a submachine state with an
explicit exit point.
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:
O'Reilly
Figure 8-10.
Credit
card validation submachine state with explicit
Pub Date: June 2005
exit point
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
solutions
a consistent,
tool-supported
language.
Ifcommunicate
the submachine
state in
is entered
through
the default initial
pseudostate or exited because of
the completion of the submachine, you don't need to show explicit entry/exit points. The state
Today, UML
hasinbecome
the standard
modeling
software
whichexit
means
machine
shown
Figure 8-10
uses themethod
default for
initial
pseudostate
andsystems,
two different
you're A
probably
confronting
this richmay
and be
expressive
language
more
than
ever before.
And
points.
submachine
state machine
used multiple
times
within
a containing
state
even
though
you
may
not
write
UML
diagrams
yourself,
you'll
still
need
to
interpret
machine, and different references to the submachine may show different entry/exit points
diagrams
written
by others.
based
on what
is relevant
to the current submachine state.

UMLclarity
2.0 inyou
a Nutshell
O'Reilly
feels your
pain.
It's been
for professionals
like is
For
may usefrom
the same
composite
icon
to show
thatcrafted
the referenced
submachine
you who
must read,
create,
andFigure
understand
systema artifacts
expressed
using
UML.
defined
elsewhere
in the
model.
8-11 shows
submachine
state with
the
composite
Furthermore, it's been fully revised to cover version 2.0 of the language.
icon.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML Figure
or object-oriented
concepts.
8-11. Aprogramming
submachine
state showing the composite icon
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams

8.2.3.Extension
Transitions
Mechanisms
The Object Constraint Language (OCL)
A transition shows the relationship, or path, between two states or pseudostates. It
represents the actual change in the configuration of a state machine as it heads from one
state to the next. Each transition can have a guard condition that indicates if the transition
If you're
new
to UML, a(enabled)
tutorial with
realisticthat
examples
beento
included
can
even be
considered
, a trigger
causes has
the even
transition
executetoifhelp
it is you
quickly
familiarize
yourself
with
the
system.
enabled, and any effect the transition may have when it occurs.
Transitions are shown as a line between two states, with an arrowhead pointing to the
destination state. You specify the details of the transition using the following syntax:

www.it-ebooks.info

trigger [guard ] / effect


UML 2.0 in a Nutshell

where:

trigger

ByDan Pilone,Neil Pitman


...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Indicates what condition may cause this transition to occur. The trigger is typically the
name of an event, though it may be more complex.
Table of Contents | Index

guard

System developers have used modeling languages for decades to specify, visualize,
Is a constraint
that is
evaluated
when
an event
is fired
by the(UML)
state machine
construct,
and document
systems.
The
Unified
Modeling
Language
is one of to
those
determine
the transition
should
be enabled.
Guards
should not
any side
effects
languages.
UML ifmakes
it possible
for team
members
to collaborate
by have
providing
a common
and
must
evaluate
to
a
boolean.
Guards
will
always
be
evaluated
before
a
transition
is
language that applies to a multitude of different systems. Essentially, it enables you to
fired.
The
order
in
which
multiple
guards
are
evaluated
isn't
defined.
A
guard
can
communicate solutions in a consistent, tool-supported language.
involve tests of states in the current state machinefor example, not in Dialing or in
WaitingForCall
. Thethe
state
namesmethod
can be for
fullymodeling
qualifiedsoftware
if necessary.
Today,
UML has become
standard
systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
effect
diagrams written by others.
Specifies an activity that is executed when a transition happens. This activity can be
UML 2.0
in a Nutshell
from O'Reilly
feels your
It'sthe
been
crafted
for professionals
like
written
using operations,
attributes,
and pain.
links of
owning
classifier
as well as any
you who
must read,
create,
and understand
artifactsmay
expressed
using
UML. events
parameters
of the
triggering
event. An system
effect activity
explicitly
generate
Furthermore,
it's beensignals
fully revised
to cover
version 2.0 of the language.
such as sending
or invoking
operations.

This comprehensive
new edition
not only
provides
a quick-reference to all UML 2.0 diagram
Figure
8-12 shows several
transitions
between
states.
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

8.2.3.1.
Transition types
Topics include:
UML defines
several
specific
types
transitions. These are described in the following list.
The role
and value
of UML
in of
projects
There are no special symbols associated with transition types. They are defined only for clarity
The object-oriented
and common
vocabulary. paradigm and its relation to the UML

An integrated approach to UML diagrams


Classtransition
and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
Compound
and Deployment Diagrams
A representation of the change from one complete state machine configuration to
ExtensionCompound
Mechanisms
another.
transitions are a set of transitions, choices, forks, and joins leading
to a set of target states.
The Object Constraint Language (OCL)
High-level transition

If you're
new to UML,
withstate.
realistic
examples
has even
included
to help the
you
A transition
fromaatutorial
composite
If the
destination
of thebeen
transition
is outside
quickly
familiarize
yourself
with
the
system.
composite state, all the substates are exited, and their exit activities are run, followed
by the exit activity of the composite state. If the transition ends with a target inside the
composite state, the exit activity of the composite state isn't run.

www.it-ebooks.info

Figure 8-12. A state machine with several transitions


UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
Internal transition
diagrams written by others.
A transition between states within the same composite state. The containing state isn't
UML 2.0
in a or
Nutshell
from
O'Reilly
your pain.
It's been
craftedfrom
for professionals
exited
reentered
during
thefeels
transition.
A transition
directly
one region of like
a
you who
must read,
and understand
artifacts expressed
UML.
composite
statecreate,
to another
region in thesystem
same composite
state isn'tusing
allowed.
Furthermore, it's been fully revised to cover version 2.0 of the language.

This comprehensive
Completion
transition new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or
object-oriented
A transition
from aprogramming
state that hasconcepts.
no explicit trigger. When a state finishes its do
activities, a completion event is generated. This event is placed in the event pool and
Topicsdispatched
include: before any other event (see "Event Processing"). If the completion
transition's guard conditions (if there are any) are met, the transition is triggered. You
can have multiple completion transitions, however they must have mutually exclusive
The role
and valueAof
UML in projects
guard
conditions.
completion
transition from an orthogonal composite state will be
taken when all the regions have reached their final state and have completed their do
The object-oriented paradigm and its relation to the UML
activities.
An integrated approach to UML diagrams
Class
and Object,
Use Case, Sequence, Collaboration, Statechart, Activity, Component,
8.2.3.2.
Signal
symbols
and Deployment Diagrams
Transitions may be shown in more detail using explicit icons to show signal sending, signal
Extension
Mechanisms
receipt,
and effect
activities. These icons are not necessary and are simply used to provide a
more transition-oriented view of a state machine.
The Object Constraint Language (OCL)
You can show a transition that receives a signal by showing an unlabeled transition from the
source state to a rectangle with a triangular notch on one side. The signal's signature is
shown
inside
rectangle.
Complete
the diagram
by showing
an been
unlabeled
transition
If you're
newthe
to UML,
a tutorial
with realistic
examples
has even
included
to help you
pointing
from
the
rectangle
to
the
target
state.
Figure
8-13
shows
a
detailed
view of a
quickly familiarize yourself with the system.
transition receiving a signal.
You can show a transition that sends a signal as part of the transition effect by drawing an
unlabeled transition pointing from the source state to a rectangle with a triangular point on
one side. The signature of the signal (including parameters) is shown inside the rectangle.
Another unlabeled transition links the rectangle to the target state. Figure 8-14 shows a

www.it-ebooks.info

detailed view of a transition sending a signal.

UML 2.0 in a Nutshell


ByDan Pilone,
Neil Pitman
Figure 8-13.
A transition-oriented
view showing a signal being
...............................................
received
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.

Figure 8-14. Transition-oriented view of a signal being dispatched

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
Anshow
integrated
to as
UML
diagrams
You can
effectsapproach
that occur
a result
of a transition using a simple rectangle. The
description of the activity is written inside the rectangle. As with signal icons, you link
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
everything together with an unlabeled transition from the source state to the rectangle, and
and Deployment Diagrams
then from the rectangle to the target state. Figure 8-15 shows details of the effects of a
transition.
Extension Mechanisms
The Object Constraint Language (OCL)

8.2.3.3. Transitions and composite states


you're new
to UML,
a tutorial
with
examples
has evenstate
beenisincluded
to help
you.
AIftransition
from
an external
state
to realistic
the border
of a composite
called default
entry
quickly
familiarize
yourself
with
the
system.
The entry activity of the composite state is executed, and then the default transition to a
substate occurs.
A transition from an external state to a specific substate of a composite state is called explicit
entry . The entry activity for the composite state is executed before the substate becomes
active.

www.it-ebooks.info

Whenever a state machine transitions to an orthogonal composite state (a composite state


with two or more regions), each region is entered either explicitly or by default. If the
composite stateUML
is entered
through an explicit entry, any other region is entered using its
2.0 in a Nutshell
default transition.
ByDan Pilone,Neil Pitman

...............................................
Publisher:O'Reilly
Pub Date: June 2005
Figure
Transition-oriented
ISBN:8-15.
0-596-00795-7
Pages:234

view with an activity

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
When leaving a composite state the exit activities for the active substates are executed from
the inside out. In other words, the deepest of the active substate's exit activities executes
Topics include:
first, and then its containing substate, and so on.
When exiting an orthogonal composite state, the active substate in each region is exited first;
The role and value of UML in projects
the exit activity for the composite state is then executed.

The object-oriented paradigm and its relation to the UML


integrated approach to UML diagrams
8.2.4.AnActivities
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
An activity represents some functionality that is executed by a system. A state can have
activities
that areMechanisms
triggered by transitions to and from the state or by events raised while in
Extension
the state. A state's activities execute only if the state is active.
The Object Constraint Language (OCL)
Each activity has a label showing when the activity executes, and an optional activity
expression. An activity is written as:
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly
familiarize
yourself
with the system.
label
/ activity
expression

You can write an activity expression using pseudocode:

www.it-ebooks.info

list.append(keystroke) ; print("*")

UML 2.0 in a Nutshell


or natural language:
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
You may omit the
slash
when you don't show the activity expression. Activity expressions can
Pages:
234

record keystroke and show password character

use attributes and operations available to the classifier owning the state machine.
UML
Table ofreserves
Contents | three
Index activity labels:

System developers have used modeling languages for decades to specify, visualize,
Entry
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages.
UML
makes
it possible
for team
members
to collaborate
by providing
a common
Triggers
when
a state
is entered.
The entry
activity
executes before
anything
else
language
that
applies
to
a
multitude
of
different
systems.
Essentially,
it
enables
you
to
happens in the state.
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
Exit
you're probably confronting this rich and expressive language more than ever before. And
even Triggers
though you
may
not write
UMLThe
diagrams
yourself,
you'll still
need
interpret
when
leaving
a state.
exit activity
executes
as the
lasttothing
in the state
diagrams
written
by others.
before
a transition
occurs.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
Do
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
Executes as long as a state is active. The do activity executes after the entry activity
and can run until
it completes,
asprovides
long as the
state machine is
This comprehensive
new
edition not or
only
a quick-reference
to in
allthis
UMLstate.
2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
Each
may have additional
activities
associated with it, and specific labels for each. See
UML state
or object-oriented
programming
concepts.
Figure 8-5 for an example of a state with several activities.
Topics include:
If the do activity completes, it causes a completion event, which can trigger a transition (see
"Dispatch"). If there is a completion transition (a transition with no other event condition), the
exit activity
executes,
andofthe
transition
occurs. If some other event causes the state to
The role
and value
UML
in projects
transition before the do activity completes, the activity is aborted, the exit activity executes,
and the
transition
occurs. paradigm and its relation to the UML
The
object-oriented
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


Dan Pilone,Neil Pitman
8.3. StateBy
Machine
Extension
...............................................
Publisher:O'Reilly
Pub Date: June 2005
0-596-00795-7
Like many otherISBN:
concepts
in UML, state machines may be specialized as needed. A specialized
234
state machine isPages:
an extension
of a general state machine. You can specialize a state machine

by adding regions, states, pseudostates, or transitions. In addition to adding features to state


machines you can redefine states, regions, and transitions.
Table of Contents | Index

When drawing a specialized state machine, draw the inherited states with dashed or graytoned lines. You may also place the keyword extended in curly braces after the name of the
state
machine.
Figure
8-16
shows
a specialized
sodafor
dispensing
state
machine.
The
System
developers
have
used
modeling
languages
decades to
specify,
visualize,
Dispensing
Drink
state
is
extended
to
introduce
a
new
substate,
Out
of
selection
The states
construct, and document systems. The Unified Modeling Language (UML) is one of. those
Releasing
Refunding
change
retain
their other
transitions, by
and
a new transition,
languages.drink
UML and
makes
it possible
for team
members
to collaborate
providing
a common
Time
expired
, isapplies
addedto
toatransition
new substate
if the
IR sensor
triggered
language
that
multitudetoofthe
different
systems.
Essentially,
it isn't
enables
you to(see
Figure
8-6 for the
original
state).
communicate
solutions
in composite
a consistent,
tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
8.4. Protocol
State Machines
...............................................
Publisher:O'Reilly
Pub Date: capture
June 2005
Protocol state machines
the behavior of a protocol, such as HTTP or a challengeISBN:0-596-00795-7
response speakeasy
door. They aren't tied to a particular implementation of a protocol;
Pages:
234
rather, they specify
the
state changes and events associated with a protocol-based
communication.
Table of Contents
| Index
Unlike
in behavioral
state machines, states in protocol state machines represent stable
situations where the classifier isn't processing any operation and the user knows its
configuration.
System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that appliesFigure
to a multitude
different
systems. Essentially,
it enables you to
8-16.ofState
machine
extension
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
Protocol state machines differ from behavioral state machines in the following ways:
The object-oriented paradigm and its relation to the UML
entry,exit, and do activities can't be used.

An integrated approach to UML diagrams

States can have invariants. Place invariants in square brackets under the state name.
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
The keyword protocol is placed in curly braces after the state machine name to indicate
the state machine is a protocol state machine.
Extension Mechanisms
Transitions in protocol state machines have a precondition (in place of the guard in
The Object Constraint Language (OCL)
normal transitions), the trigger, and a post condition. The notation for a protocol
transition is as follows:

If you're
new to UML,
a tutorial
with realistic examples
has even been included to help you
[precondition
]event
/ [postcondition
]
quickly familiarize yourself with the system.

Each transition is associated with zero or one operation on the owning classifier. The
transition guarantees that the precondition will be true before the operation is invoked,
and that the post condition will be true before entering the target state.

www.it-ebooks.info

The effect activity is never specified for a protocol transition.


Figure 8-17 shows
simplified
version of the Simple Mail Transport Protocol (SMTP) protocol.
UMLa2.0
in a Nutshell
Because protocol state machines don't not allow activities, there is little detail about what the
ByDan Pilone,Neil Pitman
SMTP server actually does when receiving a command from the client. By design, the protocol
...............................................
state machine tells you only what state the protocol implementation will be in, not what it
Publisher:O'Reilly
does to get there or how it keeps itself occupied. See "Variations on Statechart Diagrams" for
Pub Date: June 2005
an example of modeling
a protocol in more detail.
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
8.5. Pseudostates
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
0-596-00795-7
Pseudostates are
special
types of states that represent specific behavior during transitions
234Combined with basic transitions, pseudostates can represent complex
between regularPages:
states.

state changes within a state machine.


Table of Contents | Index

Figure 8-17. A simplified SMTP protocol state machine


System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
Table 8-1 shows the types of pseudostates and their symbols. Refer to Figure 8-1 for an
UML or object-oriented programming concepts.
example showing how these symbols are used.
Topics include:
The role and value of UML in projects

Table 8-1. Types of pseudostates

The object-oriented paradigm and its relation to the UML


Pseudostate
Symbol
Description
An integrated
approach to UML diagrams
name

Collaboration,
Activity,
Component,
InitialClass and Object, Use Case, Sequence,
The starting
point of a Statechart,
state machine.
The transition
and Deployment Diagrams
pseudostate
from the initial pseudostate to the first full state may
be labeled with the event that instantiates the object
Extension Mechanisms
the state machine is modeling.
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

Choice
UML 2.0 in a Nutshell

Allows the execution of a state machine to choose


between several different states based on guard
conditions on the transitions (see Figure 8-17).

ByDan Pilone,Neil Pitman

Deep history

...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Used inside a state region, a transition to this
Pages:234

Table of Contents | Index

pseudostate from outside the region indicates the state


machine should resume the last substate it was in
within the given region, no matter how "deep" the
substate is within the region.

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages.
team members
to collaborate
byaproviding
common
Entry
point UML makes it possible for Represents
a possible
target for
transitionainto
a
language that applies to a multitude of
different state.
systems.
Essentially,
it enables
you to to
composite
An entry
point can
then transition
communicate solutions in a consistent,
language.
antool-supported
internal substate
that may differ from the default
transition. You must label entry points by writing their
Today, UML has become the standardname
method
fortomodeling
software systems, which means
next
the symbol.
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
Exit point
Represents a possible source for a transition from a
UML 2.0 in a Nutshell from O'Reilly feels
your pain.
It'sLike
been
crafted
for professionals
like
composite
state.
entry
points,
exit points are
you who must read, create, and understand
artifacts
expressed using UML.
labeled system
with their
names.
Furthermore, it's been fully revised to cover version 2.0 of the language.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Fork
and
join
Topics
include:

Represents a split in the execution of the state machine


into orthogonal regions. The join reunites the regions
into a single transition. The state machine won't
transition from the join until all regions have
The role and value of UML in projects
transitioned to the join pseudostate.
The object-oriented paradigm and its relation to the UML

An integrated approach to UML diagrams


Junction
Brings several possible transitions together into one
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
pseudostate. One or more transitions may then leave
and Deployment Diagrams
the junction to other states.

Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

Shallow
history

Used inside a state region, a transition to this


pseudostate from outside the region indicates the state
machine should resume the last substate it was in
UML 2.0 in a Nutshell
within the given region, however the substate must be
ByDan Pilone,Neil Pitman
at the same level as the history pseudostate. You may
...............................................
specify a default "previous state" by showing a single
Publisher:O'Reilly
transition from the shallow history pseudostate to an
Pub Date: June 2005
internal substate. This is used only if the region has
ISBN:0-596-00795-7
never been entered.
Pages:234

Terminate
node
Table of Contents | Index

Causes the state machine to terminate.

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


Dan Pilone,Neil Pitman
8.6. EventBy
Processing
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
Information within
a 0-596-00795-7
state machine is conveyed via events. Events can be triggered by things
Pages:
234
outside of the state
machine
or as part of an activity executing within a state. An event can

have parameters and attributes you can use when processing the event.
Table of Contents | Index

8.6.1. Dispatch
System developers have used modeling languages for decades to specify, visualize,
As
events are
are added
to an event
pool.Language
Once added
to the
event
construct,
andtriggered,
documentthey
systems.
The Unified
Modeling
(UML)
is one
of pool,
those
events
are sent
for processing
state
machine
are dispatched
. The order
of event
languages.
UMLout
makes
it possible by
forthe
team
members
to or
collaborate
by providing
a common
dispatch
and
processing
isn't
specified
by
UML.
This
allows
state
machines
to
impose
their
language that applies to a multitude of different systems. Essentially, it enables you to
own
prioritization
schemes
events if desired.
communicate
solutions
in aon
consistent,
tool-supported language.
When dispatching events, a new event is dispatched and processed only after the previous
Today, UML has become the standard method for modeling software systems, which means
event has been fully processed. This doesn't mean that all do activities (see "Activities") are
you're probably confronting this rich and expressive language more than ever before. And
complete, just that the state machine is in a well-defined condition, with entry and exit
even though you may not write UML diagrams yourself, you'll still need to interpret
activities completed. This is called run-to-completion by the UML specification.
diagrams written by others.
After an event is dispatched, if no transitions are enabled and the event isn't deferred (see
UML 2.0 inEvents"),
a Nutshellthefrom
O'Reilly
feels your
It's been
professionals like
"Deferred
event
is discarded,
andpain.
the next
eventcrafted
can befor
processed.
you who must read, create, and understand system artifacts expressed using UML.
it'strigger
been fully
cover version
IfFurthermore,
an event does
one revised
or moreto
transitions,
such2.0
as of
in the
the language.
case of orthogonal states (see
"Composite States"), the order in which the transitions are fired isn't specified by UML. Once
This
comprehensive
newfired,
edition
onlyisprovides
a quick-reference
to all UML 2.0 diagram
all
transitions
have been
thenot
event
considered
complete.
types, it also explains key concepts in a way that appeals to readers already familiar with
or object-oriented
concepts.
IfUML
a synchronous
activityprogramming
is triggered by
a transition, the event processing isn't complete until
the invoked object has finished its run-to-completion step.
Topics include:
When dispatching events, UML allows for transitions to conflict. However, only one out of a set
of conflicting transitions is allowed to execute. If an event triggers two different transitions
Thesame
role and
value
UMLmachine
in projects
from the
state,
the of
state
must select only one transition to execute. The
following rules determine which transition executes:
The object-oriented paradigm and its relation to the UML

integrated
approach
diagrams
AAn
transition
starting
fromtoa UML
substate
has higher priority than a transition from any of its
containing states, and therefore is executed.
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment
Diagrams
Transitions
from an
orthogonal state are considered to have the same priority (assuming
they are at the same level), so the first transition encountered is executed.
Extension Mechanisms

The Object Constraint Language (OCL)

8.6.2. Deferred Events

If you're
new
to UML,
tutorialbe
with
realistic
examples
has even
included
to help
You
can list
events
thatashould
deferred
from
dispatching
whilebeen
in a given
state.
You you
show
quickly
familiarize
yourself
with
the
system.
a deferred event by listing the event, followed by a forward slash and the keyword defer
within the state. Figure 8-18 shows a state that defers the cancel event. If the cancel event
does fire, it is held in the event pool until the state machine leaves this state.

www.it-ebooks.info

Figure 8-18. State with deferred cancel event


UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

If an event is triggered that doesn't cause a transition, and it is on the deferred list, it will be
held in an event pool while nondeferred events are dispatched. The event will be held in the
pool until the state machine enters a state in which the event is no longer deferred, or in
System
have
used
decades
to specify, visualize,
which
thedevelopers
event would
cause
a modeling
transition.languages
The eventfor
is then
dispatched.
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages.
UML makes
it possible
for team
members
to collaborate
bymachine
providingenters
a common
To
clarify, events
that cause
a transition
can't
be deferred.
If the state
a state
language
that
applies
to
a
multitude
of
different
systems.
Essentially,
it
enables
you
to
that doesn't defer an event, and the event doesn't cause a transition, the event is lost.
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
8.7. Variations
on Statechart Diagrams
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
In addition to modeling
behavior and protocols, statecharts have been used to capture realPages:234
time system behavior.
As they do with many applications of UML diagrams, real-time system

modelers frequently use tagged values and constraints to customize the syntax for their
organization; however, almost all real-time diagrams include some notation to indicate time.
Table
of Contents
| Index is to use the keyword after to indicate a maximum allowable time for a
A
common
notation
transition to occur. Figure 8-19 shows a satellite uplink acquisition statechart that requires a
ground station to respond to satellite commands within a fixed amount of time to prevent the
acquisition
sequencehave
fromused
failing
and starting
over. for decades to specify, visualize,
System developers
modeling
languages
construct, and document systems. The Unified Modeling Language (UML) is one of those
Since
real-time
are
frequently
involved
in well-defined
protocols,
the line abetween
languages.
UMLsystems
makes it
possible
for team
members
to collaborate
by providing
common
real-time
machines
protocolofstate
machines
can blur.
There isit no
real notational
languagestate
that applies
to and
a multitude
different
systems.
Essentially,
enables
you to
difference;
it issolutions
a matterin
ofawhat
the modeler
is trying to
convey. Real-time state machines
communicate
consistent,
tool-supported
language.
often model the internal states of a system, something
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
Figure
8-19. A sample real-time statechart diagram
diagrams written
by others.

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
deliberately avoided by protocol state machines. If the modeler doesn't capture the internal
Mechanisms
states Extension
of a system,
or if the implementation is simple enough that there are no additional
internal states, the state machine can wind up being a model of the protocol. Figure 8-19 is
Constraint
Language
closer The
to aObject
protocol
state machine
than(OCL)
a detailed implementation model; each state in the
figure can be represented by one or more smaller, internal states in a real implementation.
However, according to the strict definition of protocol state machines, entry activities can't be
used, so Figure 8-19 isn't tagged with the {protocol} tag.
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

Chapter 9. Activity Diagrams

...............................................
Publisher:O'Reilly
Pub Date: June 2005
Activity modeling
focuses on the execution and flow of the behavior of a system, rather than
ISBN:0-596-00795-7
how it is assembled.
more than any other UML diagram, activity diagrams apply to
Pages:Possibly
234

much more than just software modeling. They are applicable to just about any type of
behavioral modeling; for example, business processes, software processes, or workflows.
Activity
diagrams
Table of Contents
| Indexcapture activities that are made up of smaller actions .

When used for software modeling, activities typically represent a behavior invoked as a result
of a method call. When used for business modeling, activities may be triggered by external
System developers have used modeling languages for decades to specify, visualize,
events, such as an order being placed, or internal events, such as a timer to trigger the
construct, and document systems. The Unified Modeling Language (UML) is one of those
payroll process on Friday afternoons. Activity diagrams have undergone significant changes
languages. UML makes it possible for team members to collaborate by providing a common
with UML 2.0; they have been promoted to first-class elements and no longer borrow
language that applies to a multitude of different systems. Essentially, it enables you to
elements from state diagrams.
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
9.1. Activities
and Actions
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
An activity is a behavior
that is factored into one or more actions. An action represents a
Pages:
234
single step within
an activity
where data manipulation or processing occurs in a modeled

system. "Single step" means you don't break down the action into smaller pieces in the
diagram; it doesn't necessarily mean the action is simple or atomic. For example, actions can
Table of Contents | Index
be:
Mathematical
System
developersfunctions
have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
Calls to other behaviors (modeled as activities)
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
Processors of data (attributes of the owning object, local variables, etc.)
communicate solutions in a consistent, tool-supported language.
Translating these into real examples, you can use actions to represent:
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
evenCalculating
though yousales
may tax
not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
Sending order information to a shipping partner
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
Generating
a listcreate,
of items
that
need to be
reordered
because
of low using
inventory
you who
must read,
and
understand
system
artifacts
expressed
UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
When you use an activity diagram to model the behavior of a classifier, the classifier is said to
be
thecomprehensive
context of the new
activity.
Thenot
activity
can access
the attributes and
operations
the
This
edition
only provides
a quick-reference
to all
UML 2.0 of
diagram
classifier,
any
objects
linked
to
it,
and
any
parameters
if
the
activity
is
associated
with
a
types, it also explains key concepts in a way that appeals to readers already familiar with
behavior.
When used to programming
model business
processes, this information is typically called processUML or object-oriented
concepts.
relevant data . Activities are intended to be reused within an application, and actions are
typically
specific and are used only within a particular activity.
Topics include:
You show an activity as a rectangle with rounded corners. Specify the name of the activity in
the upper
You value
can show
parameters
involved in the activity below the name.
The left.
role and
of UML
in projects
Alternatively, you can use parameter nodes , described later in this section. Figure 9-1 shows
a simple
Theactivity.
object-oriented paradigm and its relation to the UML

An integrated approach to UML diagrams


Class and Object,
Use9-1.
Case,ASequence,
Collaboration,
Statechart,
Activity, Component,
Figure
simple activity
with
no details
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.
You can show the details for an activity inside of the rectangle, or, to simplify a diagram,
leave off the surrounding rectangle altogether. You show actions using the same symbol as an
activity: a rectangle with rounded corners; place the name of the action in the rectangle.

www.it-ebooks.info

Figure 9-2 shows some actions inside of an activity.

UML 2.0 in a Nutshell


ByDan Figure
Pilone,Neil Pitman
9-2.

Activity with simple details

...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language
that applies
to a more
multitude
of different
systems.
you to
To
make activity
diagrams
expressive,
you can
write Essentially,
pseudocodeitorenables
applicationcommunicate
solutions
in
a
consistent,
tool-supported
language.
dependent language inside an action. Figure 9-3 shows an example of an action with a
domain-specific block of code.
Today, UML has become the standard method for modeling software systems, which means
you're
probably
confronting
this rich
and expressive
language
more
than final
ever node.
before.
And an
Each
activity
typically
starts with
an initial
node and ends
with an
activity
When
even though
you
not write
UML diagrams
yourself,
you'll still
need
to an
interpret
activity
reaches
anmay
activity
final node,
the activity
is terminated.
You
show
initial node as a
diagrams
written
by others.
black
dot and
an activity
final node as a solid circle
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been
fully revised
version
2.0 of
the language.
Figure
9-3. to
Ancover
action
with
pseudocode
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Mechanisms
with aExtension
ring around
it. See "Control Nodes" for more information on initial and final nodes.
Figure 9-4 shows an activity with initial and final nodes.
The Object Constraint Language (OCL)

Figure 9-4. An activity diagram with initial and final nodes

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
Activities
may
pre- and
postconditions
thatModeling
apply to Language
the entire (UML)
activity.
You of
show
a
construct,
andhave
document
systems.
The Unified
is one
those
precondition
by placing
keyword
top centerbyofproviding
the activity
and then
languages. UML
makes the
it possible
forprecondition
team membersattothe
collaborate
a common
place
the constraint
immediately
afterofit.different
You show
a post-condition
using
the keyword
language
that applies
to a multitude
systems.
Essentially,
it enables
you to
postcondition
.Figure 9-5
an activity
with pre- language.
and postconditions.
communicate solutions
in a shows
consistent,
tool-supported
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though
you9-5.
may not
write UML
diagrams with
yourself,
you'll
still postconditions
need to interpret
Figure
Activity
diagram
preand
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The may
role and
UML
in postconditions
projects
An action
havevalue
local of
preand
that should hold true before the action is
invoked and after it has completed, respectively. However, the UML specification doesn't
object-oriented
paradigm and
to the UML
dictateThe
how
pre- and postconditions
mapits
to relation
implementation;
violations of the conditions are
considered implementation-dependent and don't necessarily mean the action can't execute.
An integrated approach to UML diagrams
You show pre- and postconditions using notes attached to the action. You label the note with
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
the keyword localPrecondition or localPostcondition.Figure 9-6 illustrates this.
and Deployment Diagrams

Extension Mechanisms

Figure
An
activity
diagram
with local pre- and postconditions for
The9-6.
Object
Constraint
Language
(OCL)
actions
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

9.1.1. Activity Edges

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
In
order
to show
anUML
activity,
you link
actionsyou'll
together
usingtoactivity
edges .
even
though
youflow
maythrough
not write
diagrams
yourself,
still need
interpret
Edges
specify
how
control
and
data
flow
from
one
action
to
the
next.
Actions
that
aren't
diagrams written by others.
ordered by edges may execute concurrently; the UML specification leaves it up to the specific
implementation
of an activity
diagram
to say
actions
actuallyfor
execute
in parallel
UML 2.0 in a Nutshell
from O'Reilly
feels
yourwhether
pain. It's
been crafted
professionals
likeor
are
sequentially.
youhandled
who must
read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
You show an activity edge as a line with an arrow pointing to the next action. You can name
edges by placing the name near the arrow, though most edges are unnamed. Figure 9-6 (as
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
well as the earlier figures) shows an activity diagram with several activity edges.
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

9.1.1.1.
Control flows
Topics include:
UML offers a specialized activity edge for control-only elements, called a control flow . A
role
and value
of UML
in projects
controlThe
flow
explicitly
models
control
passing from one action to the next. In practice,
however, few people make the distinction between a generic activity edge and a control flow
The object-oriented paradigm and its relation to the UML
because the same notation is used for both.

An integrated approach to UML diagrams

9.1.1.2.
Object
flows Use Case, Sequence, Collaboration, Statechart, Activity, Component,
Class
and Object,
and Deployment Diagrams
Extension
Mechanisms
UML offers
a data-only
activity edge, called object flows . Object flows add support for
multicasting data, token selection, and transformation of tokens. The notation for object flows
Object
Constraint
Language
(OCL)
is the The
same
as that
for a generic
activity
edge.
You can use an object flow to select certain tokens to flow from one activity to the next by
providing a selection behavior . You indicate a selection behavior by attaching a note to the
If you're new to UML, a tutorial with realistic examples has even been included to help you
object flow with the keyword selection and the behavior specified. Figure 9-7 shows
quickly familiarize yourself with the system.
selecting the top candidates from potential new hires. See "Object Nodes" for details on
modeling objects.

Figure 9-7. Activity diagram where objects are selected based on a

www.it-ebooks.info

selection behavior
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
You
can assign
object flows
that transform
passed(UML)
alongisanone
edge;
however,
construct,
and behaviors
document to
systems.
The Unified
Modelingdata
Language
of those
the
behaviorUML
can'tmakes
have any
side effects
on the
originaltodata.
You show
languages.
it possible
for team
members
collaborate
by transformation
providing a common
behaviors
a note to
attached
to theofobject
flow.
Label the
note with itthe
keyword
language using
that applies
a multitude
different
systems.
Essentially,
enables
you to
TRansformation
, and write
the behavior
under the label.
Figure 9-8 shows an example of a
communicate solutions
in a consistent,
tool-supported
language.
transformation behavior that extracts student identification from course registrations to verify
that
the UML
student's
accountthe
is fully
paid. method for modeling software systems, which means
Today,
has become
standard
you're probably confronting this rich and expressive language more than ever before. And
Object
flows allow
you to
sending
data to
multipleyou'll
instances
of a to
receiver
using
even though
you may
notspecify
write UML
diagrams
yourself,
still need
interpret
multicasting
. For example,
if you are modeling a bidding process, you can show a Request for
diagrams written
by others.
Proposal (RFP) being sent to multiple vendors and their responses being received by your
activity.
sending
to multiple
receivers
by been
labeling
an object
flow with the
UML 2.0 You
in a show
Nutshell
fromdata
O'Reilly
feels your
pain. It's
crafted
for professionals
like
keyword
and youand
show
data being
received
from multiple
senders
by labeling an
you whomulticast
must read,, create,
understand
system
artifacts
expressed
using UML.
object
flow with
the
keyword
multireceive
Figure 9-9
activity diagram modeling
Furthermore,
it's
been
fully revised
to cover .version
2.0 shows
of the an
language.
an RFP process.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
There
times
when an
action
may in
accept
oneto
type
of valid
inputfamiliar
to beginwith
types,are
it also
explains
key
concepts
a waymore
that than
appeals
readers
already
execution.
For example, programming
a human resources
action named Adjust Salary may require an
UML or object-oriented
concepts.
Employee object and either a New Hire Document or Yearly Performance Review Document, but
not
both.
You can show groups and alternatives for input pins (see "Pins" under "Object
Topics
include:
Nodes") by using parameter sets . A parameter set groups one or more pins and indicates that
they are all that are needed for starting or finishing an action. An action can use input pins
only from
setUML
for any
given execution, and likewise output on only one output
The one
role parameter
and value of
in projects
parameter set. You show a parameter set by drawing a rectangle around
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams

Figure 9-8. Activity diagram with a transformation behavior to


Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
traverse an object and extract the needed information
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting
this rich
and
expressive object
language flows
more than ever before. And
Figure
9-9.
Multicast
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
the pins included in the set. Figure 9-10 shows the Adjust Salary action with parameter sets.
An integrated approach to UML diagrams
Class
and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
9.1.1.3.
Connectors
and Deployment Diagrams
Extension
To simplify
largeMechanisms
activity diagrams you can split edges using connectors . Each connector is
given a name and is purely a notational tool. You place the name of a connector in a circle
The Object Constraint Language (OCL)
and then show the first half of an edge pointing to the connector and the second half coming
out of the connector. Figure 9-11 shows two equivalent activity diagrams; one with a
connector and one without.
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

Figure 9-10. Action with parameter sets

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML
2.0 in9-11.
a Nutshell
from O'Reilly
feels your
pain. It's been
crafted
foraprofessionals
Figure
Equivalent
activity
diagrams,
one
with
connectorlike
and
you who must read, create, and understand
system artifacts expressed using UML.
one without
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
9.2. Tokens
...............................................
Publisher:O'Reilly
Pub models
Date: June
2005
Conceptually, UML
information
moving along an edge as a token. A token may
ISBN:an
0-596-00795-7
represent real data,
object, or the focus of control. An action typically has a set of required
Pages:
234 executing until the inputs are met. Likewise, when an action
inputs and doesn't
begin
completes, it typically generates outputs that may trigger other actions to start. The inputs
and outputs of an action are represented as tokens.
Table of Contents | Index

Each edge may have a weight associated with it that indicates how many tokens must be
available before the tokens are presented to the target action. You show a weight by placing
the
keyword
weight in
curly
brackets
({})languages
equal to the
of tokens.
A weight of
System
developers
have
used
modeling
for desired
decadesnumber
to specify,
visualize,
null
indicates
tokens should
be made
available
to the Language
target action
as soon
asofthey
arrive.
construct,
andall
document
systems.
The Unified
Modeling
(UML)
is one
those
For
example,UML
Figure
9-12it shows
that
players
are needed
before by
youproviding
can make
a baseball
languages.
makes
possible
fornine
team
members
to collaborate
a common
team.
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably
confronting
thisActivity
rich and expressive
more than
ever before. And
Figure
9-12.
diagramlanguage
with edge
weights
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
In addition to weights, each edge may have a guard condition that is tested against all
tokens.
If the
condition
fails,
the token is destroyed. If the condition passes, the token
The
roleguard
and value
of UML
in projects
is available to be consumed by the next action. If a weight is associated with the edge, the
tokensThe
aren't
tested against
the guard
condition
untiltoenough
tokens are available to satisfy
object-oriented
paradigm
and
its relation
the UML
the weight. Each token is tested individually, and if one fails, it is removed from the pool of
An integrated
approach
to the
UMLnumber
diagrams
available
tokens. If this
reduces
of tokens available to less than the weight for the
edge, all the tokens are held until enough are available. You show a guard condition by
and Object,
Use Case,
Sequence,
Collaboration,
Statechart,
Activity,
Component,
puttingClass
a boolean
expression
in brackets
([]) near
the activity
edge. Guard
conditions
are
andused
Deployment
Diagrams
typically
with decision
nodes to control the flow of an activity (see "Decision and merge
nodes").
Extension Mechanisms

The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
9.3. Activity
Nodes
...............................................
Publisher:O'Reilly
Pub Date: June 2005
0-596-00795-7
UML 2.0 definesISBN:
several
types of activity nodes to model different types of information flow.
Pages:nodes
234
There are parameter
to represent data being passed to an activity, object nodes to

represent complex data, and control nodes to direct the flow through an activity diagram.
Table of Contents | Index

9.3.1. Parameter Nodes


System developers have used modeling languages for decades to specify, visualize,
You
can represent
parameters
to anThe
activity
or output
from
an executed
construct,
and document
systems.
Unified
Modeling
Language
(UML)activity
is one as
of parameter
those
nodes
. You show
a parameter
nodefor
as team
a rectangle
on the
boundary of
activity, awith
the
languages.
UML makes
it possible
members
to collaborate
byan
providing
common
name
or
description
of
the
parameter
inside
the
rectangle.
Input
parameter
nodes
have
language that applies to a multitude of different systems. Essentially, it enables you to edges
to
the first action,
and output
parametertool-supported
nodes have edges
coming from the final action to the
communicate
solutions
in a consistent,
language.
parameter node. Figure 9-13 shows an example of wood being fed into a paper production
activity,
and paper
being produced
at the
end. for modeling software systems, which means
Today, UML
has become
the standard
method
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.

Figure 9-13. Activity diagram with incoming and outgoing


parameters
UML 2.0 in a Nutshell from O'Reilly feels
your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
integrated approach to UML diagrams
9.3.2.AnObject
Nodes
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
To represent complex data passing through your activity diagram, you can use object nodes .
An object
node represents
an instance of a particular classifier in a certain state. Show an
Extension
Mechanisms
object node as a rectangle, with the name of the node written inside. The name of the node is
Thethe
Object
(OCL) Figure 9-14 is an activity diagram showing a
typically
type Constraint
of data theLanguage
node represents.
factory producing parts for shipping.
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize
yourself
withObject
the system.
Figure
9-14.
nodes in an activity diagram

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

If the type of data the node represents is a signal, draw the node as a concave pentagon. See
Figure 9-37 in "Interruptible Activity Regions" for an example of a signal in an activity
diagram.
System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
9.3.3.
Pins
language
that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Today,
UML ahas
become
the standard
method
modeling
software
which
means
UML
defines
special
notation
for object
nodes,for
called
pins, to
providesystems,
a shorthand
notation
you're
confronting
rich and
expressive
language
than
ever
before.
And 9for
inputprobably
to or output
from anthis
action.
For example,
because
themore
action
Ship
Parts
in Figure
even
though
UML
you'll labeled
still need
to.interpret
14
requires
a you
Partmay
, younot
canwrite
define
an diagrams
input pin yourself,
on Ship Parts
Part
You show a pin
diagrams
written
by others.
using
the same
rectangle
as for object nodes, except the rectangle is small and attached to
the side of its action. If it is an input pin, any edges leading into the action should point to the
UML 2.0
frompin,
O'Reilly
feels your
pain.
beenshould
craftedleave
for professionals
input
pin;inifaitNutshell
is an output
any edges
leaving
theIt's
action
from the pin.like
Figure
you who
must
create,
understand
system
9-15
shows
the read,
Create
Partsand
diagram
rewritten
usingartifacts
pins. expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains
concepts
in a way
that input
appealsand
to readers
already
familiar with
Figurekey
9-15.
Actions
with
output
pins
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Mechanisms
If the Extension
output from
an action is related to an exception (error condition), you indicate that the
pin is an exception pin by inserting a small arrow near the pin. Figure 9-16 shows the Create
Object
Language (OCL)
Parts The
action
with Constraint
error handling.

If you're new to UML, a tutorial with realistic examples has even been included to help you
Figure
9-16.with
Activity
diagram with an exception pin
quickly familiarize
yourself
the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

If you don't have edges leading into or out of an action, you can show whether a pin is an
input pin or an output pin by placing small arrows inside the pin rectangle. The arrow should
point toward the action if you are showing an input pin and away from the action if you are
System an
developers
have
used9-17
modeling
decades
to specify,
visualize,
showing
output pin.
Figure
showslanguages
an action for
with
input and
output pins.
construct, and document systems. The Unified Modeling Language (UML) is one of those
UML makes
it possible
team members
to collaborate
providing
common
Iflanguages.
an action takes
a constant
value for
as input,
you can model
the inputby
data
using aavalue
pin . A
language
that
applies
to
a
multitude
of
different
systems.
Essentially,
it
enables
you
tothe
value pin is shown as a normal input pin, except the value of the object is written near
communicate
solutions
in a consistent,
tool-supported
rectangle.
Figure
9-18 shows
an activity diagram
with a language.
value pin.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you
may not
write UML
diagrams
need to
interpret
Figure
9-17.
Action
withyourself,
input you'll
and still
output
pins
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:

Figure
Action
The role and value
of UML 9-18.
in projects

with a value pin

The object-oriented paradigm and its relation to the UML


An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

9.3.4. Control Nodes


If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.
In addition to actions, activities may include other nodes to represent decision making,
concurrency, or synchronization. These specialized nodes are called control nodes and are
described in detail in this section.

www.it-ebooks.info

9.3.4.1. Initial nodes


Aninitial node isUML
the2.0
starting
point for an activity; an initial node can have no incoming edges.
in a Nutshell
You can have multiple initial nodes for a single activity to indicate that the activity starts with
ByDan Pilone,Neil Pitman
multiple flows of execution. You show an initial node as a solid black dot, as shown in Figure
...............................................
9-4.

9.3.4.2.

Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Decision
and
Pages:
234merge nodes

Table
of Contents
| Index
A
decision
node
is a control node that chooses different output flows based on boolean
expressions. Each decision node has one input edge and multiple outgoing edges. When data
arrives at the decision node, a single outgoing edge is selected, and the data is sent along
that
edge.
A decisionhave
nodeused
usually
selectslanguages
an edge by
outgoing
edge's guard
System
developers
modeling
forevaluating
decades toeach
specify,
visualize,
condition
. Aand
guard
condition
is a boolean
expression
that Language
tests some(UML)
valueisvisible
the
construct,
document
systems.
The Unified
Modeling
one oftothose
activity,
typically
an attribute
of thefor
owning
data token
languages.
UML makes
it possible
team classifier
membersor
tothe
collaborate
by itself.
providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
You
show a decision
node
a diamond tool-supported
with the flows coming
into or out of the sides. You
communicate
solutions
in as
a consistent,
language.
show guard conditions by putting a boolean expression in brackets ([]) near the activity edge.
Figure
an become
activity diagram
showing
a decision
made while
wrapping
presents.
Today,9-19
UMLishas
the standard
method
for modeling
software
systems,
which means
you're probably confronting this rich and expressive language more than ever before. And
Guard
conditions
guaranteed
todiagrams
be evaluated
in any
particular
order,
and a decision
even though
youaren't
may not
write UML
yourself,
you'll
still need
to interpret
node
allows
only
one
outgoing
edge
to
be
selected.
You
should
take
care
to
design your
diagrams written by others.
models so that only one guard condition ever evaluates to true for a given set of data, to
prevent
conditions.
UML 2.0race
in a Nutshell
from O'Reilly feels your pain. It's been crafted for professionals like

you who must read, create, and understand system artifacts expressed using UML.
You can specify functionality that executes whenever data arrives at the decision node. Called
Furthermore, it's been fully revised to cover version 2.0 of the language.
decision input behavior , this functionality is allowed to evaluate the data arriving at the node
and offers output for the guard conditions to evaluate. The behavior is not allowed to have
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
any side effects when executing, since it can
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:

Figure 9-19. Activity diagram with a decision node

The role and value of UML in projects


The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

be
executed
multiple
for the
same
data examples
input (once
foreven
eachbeen
edgeincluded
that needs
to be
If you're
new
to UML,times
a tutorial
with
realistic
has
to help
you
tested).
You show decision
behavior
in a note labeled with the keyword
quickly familiarize
yourself input
with the
system.
decisionInput.Figure 9-20 shows an activity diagram that checks to see if a newly
authenticated user is the 100th user and should therefore be prompted to take a survey.

www.it-ebooks.info

Figure 9-20. Decision node with an input behavior


UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
AToday,
merge node
is effectively
thestandard
oppositemethod
of a decision
node; itsoftware
brings together
flows
UML has
become the
for modeling
systems,alternate
which means
into
a single
output
flow. It doesn't
synchronize
multiple
concurrent
see "Fork
and
join
you're
probably
confronting
this rich
and expressive
language
more flows;
than ever
before.
And
nodes"
for concurrency
support.
merge
node has
multiple
incoming
edges
and a single
even though
you may not
write A
UML
diagrams
yourself,
you'll
still need
to interpret
outgoing
A merge
node simply takes any tokens offered on any of the incoming edges
diagramsedge.
written
by others.
and makes them available on the outgoing edge.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
You
a merge
node
usingand
theunderstand
same diamond
youartifacts
use in aexpressed
decision node,
youshow
who must
read,
create,
system
usingexcept
UML. with
multiple
incoming
edgesfully
and revised
a singletooutgoing
edge. 2.0
Figure
9-21
shows how a potential new
Furthermore,
it's been
cover version
of the
language.
hire's information may be submitted to Human Resources for processing.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

Figure 9-21. Activity diagram with a merge node

Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

9.3.4.3. Fork and join nodes


Afork node splits the current flow through an activity into multiple concurrent flows. It has
one incoming edge and several outgoing edges. When data arrives at a fork node, it is

www.it-ebooks.info

duplicated for each outgoing edge. For example, you can use a fork node to indicate that
when a new person is hired, actions are initiated by Human Resources, the IT Department,
and Facilities Management. All these actions execute concurrently and terminate
independently. UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman

You show a fork...............................................


node as a vertical line, with one incoming edge and several outgoing edges.
Figure 9-22 is an
activityO'Reilly
diagram that models hiring a new employee.
Publisher:
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Figure 9-22. Example activity diagram with a fork node


Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
newthe
edition
not only
provides
quick-reference
to all UML
2.0ofdiagram
AThis
join comprehensive
node is effectively
opposite
of a fork
node;a it
synchronizes multiple
flows
an
types,
it
also
explains
key
concepts
in
a
way
that
appeals
to
readers
already
familiar
with
activity back to a single flow of execution. A join node has multiple incoming edges and
one
UML
or
object-oriented
programming
concepts.
outgoing edge. Once all the incoming edges have tokens, the tokens are sent over the
outgoing edge.
Topics include:
You show a join node as a vertical line, with multiple incoming edges and one outgoing edge.
Figure 9-23 is an activity diagram that models serving a meal.
The role and value of UML in projects

The object-oriented paradigm and its relation to the UML

Figure 9-23.
Example
activity
An integrated
approach
to UML diagrams

diagram with a join node

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
It is worth noting that activity diagrams don't have the advanced time-modeling notations
even though you may not write UML diagrams yourself, you'll still need to interpret
that interaction diagrams have. So, while it's possible to show how to prepare a meal and
diagrams written by others.
serve everything at the same time with an activity diagram, you can't capture the time
needed to cook each part of the meal. However, you can capture this information with a
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
timing interaction diagram. See Chapter 10 for more information on interaction diagrams.
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
You can specify a boolean condition to indicate under what conditions the join node will emit a
token allowing the flow to continue along its single output edge. This expression is called a
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
join specification and can use the names of incoming edges and tokens arriving over those
types, it also explains key concepts in a way that appeals to readers already familiar with
edges in the condition. You write a join specification near the join node inside of braces ({}).
UML or object-oriented programming concepts.
Figure 9-24 adds greeting guests to the steps involved in preparing a meal and ensures that
you don't serve the meal until all the guests have arrived.
Topics include:

9.3.4.4.
nodes
TheFinal
role and
value of UML in projects
The object-oriented paradigm and its relation to the UML
Two types of final nodes are used in activity diagrams: activity final and flow final . Activity
An integrated
to activity.
UML diagrams
final nodes
terminateapproach
the entire
Any tokens that arrive at the activity final node are
destroyed, and any execution in any other node is terminated, without results. You can have
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
multiple activity final nodes in a single activity diagram, but a token hitting any of them
and Deployment Diagrams
terminates the whole activity. You show an activity final node as a black dot with a circle
around it, as shown in Figure 9-4.
Extension Mechanisms
Flow final nodes terminate a path through an activity diagram, but not the entire activity.
The Object Constraint Language (OCL)
Flow final nodes are used when the flow of an activity forks, and one

If you're new to UML, a tutorial with realistic examples has even been included to help you
Figure
9-24.
node with a join specification
quickly familiarize
yourself
with Join
the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
branch of the fork should be stopped but the others may continue. Show a flow final node as
aUML
circle
X in it, from
as shown
in Figure
9-22.
2.0with
in aan
Nutshell
O'Reilly
feels your
pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
9.4. Advanced
Activity Modeling
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:several
0-596-00795-7
UML 2.0 introduces
powerful modeling notations for activity diagrams that allow you
Pages:234
to capture complicated
behaviors. Much of this new notation is clearly targeted at moving

closer to executable models, with things such as executable regions and exception handling.
While not all the notations described in this section are used in every model, these constructs
Table invaluable
of Contents | Index
are
when applied correctly.

SystemActivity
developersPartitions
have used modeling languages for decades to specify, visualize,
9.4.1.

construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
There are times when it is helpful to indicate who (or what) is responsible for a set of actions
communicate solutions in a consistent, tool-supported language.
in an activity diagram. For example, if you are modeling a business process, you can divide an
activity diagram by the office or employee responsible for a set of actions. If you are modeling
Today, UML has become the standard method for modeling software systems, which means
an application, you may want to split an activity diagram based on which tier handles which
you're probably confronting this rich and expressive language more than ever before. And
action. You split an activity diagram using an activity partition . Show an activity partition with
even though you may not write UML diagrams yourself, you'll still need to interpret
two parallel lines, either horizontal or vertical, called swimlanes , with the name of the
diagrams written by others.
partition in a box at one end. Place all nodes that execute within the partition between the
two lines. Figure 9-25 shows an activity diagram partitioned by business unit.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who
and
understand
system
artifacts
expressed
UML.
There
are must
timesread,
whencreate,
trying to
draw
a straight
line through
your
activity using
diagram
may not be
Furthermore,
it's
been
fully
revised
to
cover
version
2.0
of
the
language.
possible. You can show that a node is part of a partition by writing the partition name in
parentheses above the name of the node. If the activities within
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

Figure 9-25. Activity diagram divided into partitions

Topics include:

The role and value of UML in projects


The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

a partition occur outside the scope of your model, you can label a partition with the keyword
external. This is frequently used when performing business modeling using activity

www.it-ebooks.info

diagrams. If the behavior being modeled is handled by someone external to your business
process, you can mark the functionality with an external partition. Figure 9-26 shows
examples of naming partitions directly on the node and using external partitions.
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:
O'Reilly
Figure 9-26.
Activity
diagram with external partitions labeled on the
Pub Date: June 2005
actions
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
AUML
partition
no effect
on the
data feels
flow in
an pain.
activity,
depending
on the entity
2.0 in has
a Nutshell
from
O'Reilly
your
It's however
been crafted
for professionals
like
represented
by read,
the partition,
there
are implications
how actions
are handled.
If a partition
you who must
create, and
understand
systemon
artifacts
expressed
using UML.
represents
a UML
method
invocation
within
must be handled by
Furthermore,
it's classifier,
been fully any
revised
to cover
version
2.0 ofthat
thepartition
language.
an instance of that classifier. If the partition represents an instance, the same restrictions
apply,
except that behaviors
mustnot
be only
handled
by the
specific instancetoreferenced
bydiagram
the
This comprehensive
new edition
provides
a quick-reference
all UML 2.0
partition.
For example,
if you
are modeling
a system
that has
a partition
named
LoginService
,
types, it also
explains key
concepts
in a way
that appeals
to readers
already
familiar
with
all
actions
performed within
that partition
should be handled by an instance of your
UML
or object-oriented
programming
concepts.
LoginService. However, if you have a partition that represents an instance of a User class
named
, all actions in that partition must be handled by the CurrentUser instance.
TopicsCurrentUser
include:
To indicate that a partition represents a class, you use the keyword class before the type
name. Though the UML doesn't explicitly state it, it is customary to show that a partition
The role
and value
UML in projects
represents
an instance
byofunderlining
the type name. Figure 9-27 shows an example of a
partition representing a classifier and a partition representing an instance.
The object-oriented paradigm and its relation to the UML

An integrated approach to UML diagrams

Figure
Activity
diagram
with
partitions
representing
classes
Class 9-27.
and Object,
Use Case,
Sequence,
Collaboration,
Statechart,
Activity, Component,
and instances
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages.
UML
it possible
for team
members
to collaborate
by providing
common
Partitions
can
alsomakes
represent
attributes
with specific
values.
For example,
you can ahave
an
language
that
applies
to
a
multitude
of
different
systems.
Essentially,
it
enables
you
activity diagram, which shows that at a certain point in its execution, an attribute hasto
a
communicate
solutions
in aa consistent,
language.
specific
value. You
can use
partition totool-supported
indicate the attribute
and value available to actions
executing within that partition. Indicate that a partition represents an attribute by placing the
Today, UML
has become
the standard
method
for attribute
modelinginsoftware
systems,
whichboxes.
means
keyword
attribute
, followed
by the name
of the
a box above
the value
you're9-28
probably
rich anddiagram
expressive
language
more than
ever before.
And to
Figure
is anconfronting
example of this
an activity
in which
the UserRole
attribute
is specified
even
though
you
may
not
write
UML
diagrams
yourself,
you'll
still
need
to
interpret
indicate what level of access a user needs to perform the given actions.
diagrams written by others.
You can combine partitions to show arbitrarily complex constraints on an activity diagram. For
UML 2.0 in
a Nutshell
feels
pain.the
It'sbusiness
been crafted
for professionals
like
example,
you
can havefrom
two O'Reilly
partitions
thatyour
indicate
department
responsible
for
you who must
read, create,
andpartitions
understand
systemthe
artifacts
expressed
using
particular
functionality
and two
indicating
geographic
location
of UML.
the
Furthermore, These
it's been
revised
to cover version
2.0 ofand
theare
language.
departments.
arefully
called
multidimensional
partitions
new to UML 2.0. You can
show a multidimensional partition by using both horizontal and vertical intersecting partitions,
This
comprehensive
new edition not only provides a quick-reference to all UML 2.0 diagram
as
shown
in Figure 9-29.
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

9.4.2.
Exception Handling
Topics include:
UML 2.0
diagrams
Theactivity
role and
value ofprovide
UML in support
projectsfor modeling exception handling. An exception is
an error condition that occurs during the execution of an activity. An exception is said to be
thrownThe
by object-oriented
the source of the
error and
caught
when it
handled.
paradigm
and
its relation
toisthe
UML You can specify that an
action can catch an exception by defining an exception handler . The exception handler defines
An of
integrated
approach
to UML diagrams
the type
exception,
and a behavior
to execute when that particular exception is caught.

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams

Figure 9-28. Simple attribute partition example

Extension Mechanisms

The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
Figure 9-29. Activity diagram with multidimensional partitions
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
You show an exception handler as a regular node with a small square on its boundary. Draw a
lightning-bolt-style
edge from
the protected
node toto
the
small
The object-oriented
paradigm
and its relation
the
UMLsquare. Finally, label the edge
with the type of the exception caught by this handler. Figure 9-30 shows an example
exception
handler. approach to UML diagrams
An integrated
If an exception
action
is executing,
the execution
is abandoned
there is
Class andoccurs
Object,while
Use an
Case,
Sequence,
Collaboration,
Statechart,
Activity,and
Component,
no output
the action.
If the action has an exception handler , the handler is executed with
and from
Deployment
Diagrams
the exception information. When the exception handler executes, its output is available to the
Extension
next action
afterMechanisms
the protected node, as though the protected node had finished execution.

Object
Constraint
If the The
action
doesn't
have anLanguage
exception(OCL)
handler, the exception propagates to outer nodes until
it encounters an exception handler. As the exception leaves a node (an action, structured
activity node, or activity) all processing in the node is terminated. It is unspecified what
happens if the exception makes it to the top level of a system without being caught; UML 2.0
If you're
new
to UML,
a tutorial
withtorealistic
has even been included to help you
profiles
can
define
specific
behavior
handle examples
this.
quickly familiarize yourself with the system.

Figure 9-30. Activity diagram with an exception handler

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
9.4.3.
Expansion
languages.
UML makesRegions
it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
You can show that an action, or set of actions, executes over a collection of input data by
Today, the
UMLactions
has become
the standard
method
modeling
software
which Check
means
placing
in an expansion
region
. For for
example,
if you
had ansystems,
action named
you're
probably
confronting
rich
and expressive
language
moreyou
than
ever
before.
Out
Books
that checked
each this
of the
provided
books out
of a library,
can
model
the And
even though
mayusing
not write
UML diagrams
yourself,
you'll stillof
need
to interpret
checkout
bookyou
action
an expansion
region,
with a collection
books
as input.
diagrams written by others.
You show an expansion region using a dashed rectangle, with rounded corners surrounding
the
that
shouldfrom
execute
for each
input
a row
four input pins
UMLactions
2.0 in a
Nutshell
O'Reilly
feelspiece
your of
pain.
It'sdata.
beenPlace
crafted
for of
professionals
like on
the
boundary
to represent
a collectionsystem
of dataartifacts
coming expressed
into the region.
show a line
youdashed
who must
read, create,
and understand
using You
UML.
with
an arrow to
rowfully
of input
pins,
then
from2.0
theof
input
to the input pin of the
Furthermore,
it'sthe
been
revised
to and
cover
version
the pins
language.
first internal action. Likewise, you show a row of four output pins on the dashed boundary,
with
coming from
last action's
pin atoquick-reference
the row of fourto
output
pins
ondiagram
the
This edges
comprehensive
newthe
edition
not onlyoutput
provides
all UML
2.0
region.
shows
Check Out
expansion
region.
types, Figure
it also 9-31
explains
keythe
concepts
in a Book
way that
appeals
to readers already familiar with
UML or object-oriented programming concepts.
Topics include:

Figure 9-31. Activity diagram with an expansion region


The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)
The use of four input pins simply represents a collection of input data; it doesn't specify how
much data is actually presented to the expansion region. The region executes for each piece
If you're new to UML, a tutorial with realistic examples has even been included to help you
of data in the collection and, assuming there are no errors, offers one piece of output data
quickly familiarize yourself with the system.
from each execution.
You can use the keywords parallel,iterative, or stream to indicate if the executions
of the expansion region can occur concurrently (parallel), sequentially (iterative), or
continuously (stream). Place the keyword in the upper left of the expansion region. Figure 932 shows a video encoder that streams the frames through the various stages of encoding as

www.it-ebooks.info

soon as they are available.

UML 2.0 in a Nutshell


ByDan Pilone,
Neil Activity
Pitman
Figure
9-32.
dialog with a streaming region
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

9.4.4. Looping

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even2.0
though
youa may
not write
UML diagrams
you'll still A
need
interpret
UML
defines
construct
to model
looping inyourself,
activity diagrams.
looptonode
has three
diagrams written
others.
subregions:
setup,by
body,
and test. The test subregion may be evaluated before or after the
body subregion. The setup subregion executes only once, when first entering the loop; the
UMLand
2.0 body
in a Nutshell
O'Reilly
pain.
It's
been
crafted
for subregion
professionals
like
test
sections from
execute
eachfeels
time your
through
the
loop
until
the test
evaluates
you
who
to
false
. must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
The specification gives no suggested notation for loop nodes, however you can improvise one
using
activity regions.new
Conceptually,
loopprovides
node looks
like Figure 9-33.
This comprehensive
edition not aonly
a quick-reference
to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:

Figure 9-33. Conceptual view of a loop node

The role and value of UML in projects


The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)
Using activity partitions, you can express this as a single node, as shown in Figure 9-34.

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

Figure 9-34. A sample looping node notation

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

9.4.5. Streaming

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even
though
youtomay
not write UML
diagrams
yourself,
to interpret
An
action
is said
be streaming
if it can
produce
output you'll
while still
it is need
processing
input. For
diagramsan
written
others.
example,
actionby
representing
a compression algorithm can take audio input data from a
streamed input and send compressed audio along a streamed output.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
youindicate
who must
read,
create,is and
understand
system
expressed
using
UML. stream in
You
that
an action
streaming
its input
and artifacts
output by
placing the
keyword
Furthermore,
it'sthe
been
fullycoming
revisedintoand
cover
2.0 of Figure
the language.
braces
({}) near
edges
outversion
of an action.
9-35 shows an example
audio encoding that is streaming data.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

Figure 9-35. Activity diagram with streaming actions


Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly
familiarize
yourselfnotation
with thefor
system.
UML
provides
a shorthand
streaming edges, and input and output pins: use a
solid arrowhead or rectangle. Figure 9-36 shows the same audio encoder, but is drawn using
the streaming shorthand notation.

www.it-ebooks.info

Figure 9-36. Activity diagram with streaming actions using


shorthand notation
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate
solutions
in a consistent,
tool-supported
The
UML specification
expects
that vendors
will provide language.
base classes for domain-specific
activities users can employ to model an application-specific problem. You may also mark a set
Today,
UML
become
the standard
method
for modeling
software
systems,
of
actions
as has
streaming
using
an expansion
region.
See "Expansion
Regions"
forwhich
more means
you're probably confronting this rich and expressive language more than ever before. And
information.
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.

9.4.6.
Interruptible Activity Regions
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
You can mark that a region of your activity diagram can support termination of the tokens
and
by marking
it as an
activity
region . For example,
you
want
Thisprocessing
comprehensive
new edition
notinterruptible
only provides
a quick-reference
to all UML
2.0may
diagram
to
make
a
potentially
long-running
database
query
as
interruptible
so
that
the
user
can
types, it also explains key concepts in a way that appeals to readers already familiar with
terminate
things if he doesn't
want to wait
for the results.
UML or object-oriented
programming
concepts.
You indicate a region is interruptible by surrounding the relevant nodes with a dashed
Topics include:
rectangle that has rounded corners. You indicate how the region can be interrupted by
drawing a lightning-bolt-style edge leaving the region and connecting to the node that
assumes
If a token
leaves
the region over this edge, all other processing and
Theexecution.
role and value
of UML
in projects
tokens inside the region are terminated. The token leaving the region is unaffected.
The object-oriented paradigm and its relation to the UML
Typically the source of an interruption is the receipt of a signal from an external entity. You
show receipt
of a signal
as a concave
pentagon, with the name of the signal inside. Figure 9An integrated
approach
to UML diagrams
37 shows an example of a long-running database query being interrupted by user input.
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams

9.4.7.Extension
Central
Buffer Nodes
Mechanisms
UML 2.0
a new type
of activity
node, called the central buffer node , that provides a
Theintroduced
Object Constraint
Language
(OCL)
place to specify queuing functionality for data passing between object nodes. A central buffer
node takes inputs from several object node sources and offers them along several object node
outputs. For example, there may be two car-manufacturing plants feeding a car dealer supply
If you're
new buffer
to UML,
a tutorial
realistic
examples
has even been
included
you to
line.
A central
node
can bewith
placed
between
the manufacturing
plants
and to
thehelp
dealers
quickly
familiarize
yourself
with
the
system.
specify prioritization of deliveries or sorting of the manufactured cars. You show a central
buffer node as a rectangle with the keyword centralBuffer at the top and the

Figure 9-37. Activity diagram with an interruptible region

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
type
of object
in the
center. The
Figure
9-38 Modeling
shows anLanguage
example central
node
feeding
construct,
andwritten
document
systems.
Unified
(UML) isbuffer
one of
those
car
dealer supply
lines. it possible for team members to collaborate by providing a common
languages.
UML makes
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Figure
9-38.the
Activity
a central
Today, UML
has become
standarddiagram
method forwith
modeling
software buffer
systems,node
which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
Deployment
9.4.8.and
Data
Store Diagrams
Nodes
Extension Mechanisms
Adata store node is a special type of central buffer node that copies all data that passes
The Object Constraint Language (OCL)
through it. For example, you can insert a data store node in your activity diagram to indicate
that all interactions are logged to an external database, or that when an article is submitted
for review, it is automatically stored in a searchable archive.

If you're new to UML, a tutorial with realistic examples has even been included to help you
You show a data store node as a stereotyped version of an object node. Show the node as a
quickly familiarize yourself with the system.
rectangle, and place the keyword datastore above the name of the node. Figure 9-39 shows
a data store node.
If the same object passes through a data store node, the specification states that the previous
version of the object will be overwritten.

www.it-ebooks.info

Figure 9-39. Activity diagram with a data store node


UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
You can show transitions from a data store node that have additional information to select a
subset of the data stored in a data store node, similar to a database query. The specification
Today, UML has become the standard method for modeling software systems, which means
doesn't require any particular syntax and suggests showing the selection criteria in a note
you're probably confronting this rich and expressive language more than ever before. And
labeled with the keyword selection.Figure 9-40 shows an activity diagram that uses a data
even though you may not write UML diagrams yourself, you'll still need to interpret
store node to send welcome packets to new customers.
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Figure 9-40. Activity diagram with a data store selection
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

Chapter 10. Interaction Diagrams

...............................................
Publisher:O'Reilly
Pub Date: June 2005
A fundamental goal
of UML 2.0 is to allow users to capture more than just structural
ISBN:0-596-00795-7
relationships. UML
2.0
is intended to capture processes and flows of events. Interaction
Pages:234

diagrams draw from nearly every other facet of the language to put together a set of
diagrams that capture communications between objects. UML 2.0 has greatly expanded UML
1.x's
describe complex flow of control; one of the largest sections of the UML 2.0
Table ofability
Contentsto
| Index
specification is the interaction diagrams section. Because of the expanded functionality, quite
a bit of new terminology has been introduced. We'll cover all the terms in this chapter and try
to give you a feel for what terms are really critical and which are there to formalize the
System developers have used modeling languages for decades to specify, visualize,
specification.
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
10.1. What
Are Interactions?
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Interaction diagrams
are defined by UML to emphasize the communication between objects,
Pages:234 associated with that communication. Interaction diagrams focus on
not the data manipulation

specific messages between objects and how these messages come together to realize
functionality. While composite structures show what objects fit together to fulfill a particular
Table of Contents |interaction
Index
requirement,
diagrams show exactly how those objects will realize it.
Interaction diagrams are typically owned by elements in the system. For example, you may
have
an interaction
associated
a subsystem
that shows
how the
subsystem
System
developers diagram
have used
modelingwith
languages
for decades
to specify,
visualize,
realizes
a
service
it
offers
on
its
public
interface.
The
most
common
way
of
associating
an
construct, and document systems. The Unified Modeling Language (UML) is one of those
interaction
with itan
element
to reference
thetointeraction
in a note
attached
languages.diagram
UML makes
possible
foris team
members
collaboratediagram
by providing
a common
to
the element.
language
that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
You can show the details of an interaction using several different notations; however
sequence
diagrams
are bythe
farstandard
the mostmethod
common.
notations
include
interaction
Today, UML
has become
forOther
modeling
software
systems,
which means
overviews,
communication
diagrams,
timing
diagrams,
and interaction
tables.
you're probably
confronting
this rich and
expressive
language
more than
everBecause
before. And
sequence
diagrams
are not
used
most
frequently,
concept
is introduced
that notation.
even though
you may
write
UML
diagramseach
yourself,
you'll
still need tousing
interpret
The
other
notations
are
described
in
detail
later
in
the
chapter.
The
basic
symbol
for an
diagrams written by others.
interaction diagram is a rectangle with the keyword sd and the name of the interaction in a
pentagon
upper-left
10-1 pain.
showsIt's
anbeen
example
sequence
diagram. The
UML 2.0 ininathe
Nutshell
fromcorner.
O'ReillyFigure
feels your
crafted
for professionals
like
various
parts
ofread,
this diagram
are understand
explained throughout
the chapter.
you who
must
create, and
system artifacts
expressed using UML.

Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
Figure
10-1. in
A asample
diagram
types, it also explains
key concepts
way that sequence
appeals to readers
already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
10.2. Interaction
Participants
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
You show participants
in an interaction using a rectangle called a lifeline . The term lifeline
illustrates UML'sPages:
bias 234
toward representing interaction diagrams using the sequence diagram

notation. When shown in sequence diagrams, participants have a dashed line dropping down
from a rectangle that shows how long the object is actually in existence. When used in other
Table of Contents
| Index notations, such as communication diagrams, a lifeline is simply a
interaction
diagram
rectangle. You show the name of the participant in the rectangle using the following notation:

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
object_name [ selector ] : class_name ref decomposition
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
where:
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
object_name
diagrams written by others.
Specifies the name of the instance involved in the interaction.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
selector
Is an optional part
the name
that provides
can identify
which particular
in adiagram
This comprehensive
newof
edition
not only
a quick-reference
toinstance
all UML 2.0
element
to be used
which
in an
array with
of
types,multivalued
it also explains
key is
concepts
in a (for
wayexample,
that appeals
to EventHandler
readers already
familiar
EventHandlers
). programming concepts.
UML or
object-oriented

Topics include:
class_name

Is
the
name
the of
type
of in
this
participant.
The
role
and of
value
UML
projects

The object-oriented paradigm and its relation to the UML


decomposition

An integrated approach to UML diagrams


Is an optional part of the name that can point to another interaction diagram that
Class and
Object,
Usethis
Case,
Sequence,
Collaboration,
Statechart,
Activity,
Component,
shows
details
of how
participant
processes
the messages
it receives
(see
and Deployment Diagrams
"Decomposition").
Extension
Mechanisms
UML defines
a reserved
participant name, self, that indicates the participant is the classifier
that owns this interaction diagram.
The Object Constraint Language (OCL)
Figure 10-2 shows a trivial interaction diagram with two participants and a message between
them.
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

Figure 10-2. A trivial sequence diagram with two participants

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

You can show the destruction of a participant during an interaction using a stop symbol.
Typically this is preceded by a destroy message to the object, though that isn't strictly
System developers
have
used
modeling
languages
for decades
to specify,
necessary.
Place an X
at the
bottom
of the
lifeline where
the object
ceases visualize,
to exist. Figure 10and document
systems.
The itUnified
Modeling
(UML) is one of those
3construct,
shows destroying
a helper
class after
has finished
its Language
work.
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Figure 10-3. The destruction of a participant

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
To help make your sequence diagram accurately capture the behavior you are trying to
Mechanisms
model,Extension
you can introduce
local variables. Local variables can hold return values, loop
information, or just data you need for later processing. You show the values of local attributes
ThetoObject
Constraint
Language
(OCL)
relevant
the interaction
using
the same
attribute syntax used inside of classifiers (see
Chapter 2). Place their name and values in the upper left of the diagram, or in a note
attached to the diagram. Figure 10-4 shows a more detailed version of the HashMap interaction
using local variables.
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

Figure 10-4. A more complete HashMap interaction using local


variables

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
In
addition to
local
variables,
sequence
diagrams
can access
data in the
participants.
See
languages.
UML
makes
it possible
for team
members
to collaborate
by providing
a common
"Messages"
for applies
examples.
language that
to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
10.3. Messages
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
The focus of interaction
diagrams is on the communication between lifelines. This
234many different forms: method calls, sending a signal, creating an
communication Pages:
can take

instance, destroying an object, etc., all of which are collectively called messages . A message
specifies the kind of communication, its sender, and its receiver. For example, a
Table of Contents | Index
PoliceOfficer
class instantiating a SpeedingTicket class is represented as a message from an
instance of PoliceOfficer to the newly created instance of SpeedingTicket.
The
mostdevelopers
common use
of used
messages
is to languages
represent method
callsto
between
objects. When
System
have
modeling
for decades
specify,two
visualize,
messages
are
used
to
indicate
a
method
call,
you
can
show
the
parameters
passed
to the
construct, and document systems. The Unified Modeling Language (UML) is one of those
method
in the
message
Thefor
parameters
shouldtobe
one of theby
following:
languages.
UML
makes syntax.
it possible
team members
collaborate
providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Attributes of the sending object

Today, UML has become the standard method for modeling software systems, which means
Constants
you're probably confronting this rich and expressive language more than ever before. And
evenSymbolic
though you
may(expressions
not write UML
diagrams
yourself,
you'll
stillcan
need
to interpret
values
showing
what
the legal
values
be)
diagrams written by others.
Explicit parameters of the enclosing interaction
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who
must read,
and understand
system
artifacts expressed using UML.
Attributes
of thecreate,
class owning
the enclosing
interaction
Furthermore, it's been fully revised to cover version 2.0 of the language.
The syntax for a message is:
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
attribute = signal_or_operation_name (arguments ) : return_value
Topics include:
where:
The role and value of UML in projects

The object-oriented paradigm and its relation to the UML

attribute

An integrated approach to UML diagrams


Is an optional part of the syntax that provides a shorthand way of showing that the
return
value
from Use
this Case,
message
is storedCollaboration,
in the specified
attribute.Activity,
The attribute
must
Class and
Object,
Sequence,
Statechart,
Component,
be
attribute ofDiagrams
the lifeline sending the message, a global attribute of the interaction,
andan
Deployment
or an attribute of the class owning the interaction.
Extension Mechanisms
signal_or_operation_name
The Object Constraint Language (OCL)

Specifies the name of the operation to invoke or the signal being emitted.

If you're new to UML, a tutorial with realistic examples has even been included to help you
arguments
quickly familiarize yourself with the system.

A comma-separated list of arguments to pass to the operation or signal. The arguments


may be values or parameter names. If only argument values are used, arguments are
matched against the operation or signal signature, in order. If you want to skip an
argument, place a dash (-) where the argument would be. Skipped arguments have

www.it-ebooks.info

unknown values. You can explicitly identify a parameter name by following the text
name with a colon (:) and then the value. If you use parameter names, you can omit
arguments not relevant to the interaction. As with a dash, skipped arguments have
2.0 in a Nutshell
unknown UML
values.
ByDan Pilone,Neil Pitman

You can prefix


an argument with the keyword out or inout to indicate the argument is
...............................................
used to return
a value.
If the argument is used as an out argument, a value after the
Publisher:
O'Reilly
Pubargument
Date: Junespecification
2005
colon in the
is interpreted to be the return value.
ISBN:0-596-00795-7
Pages:234

return_value

Explicitly
states
Table of Contents
| Index

what the return value from this message will be.

Message notation varies based on the specific notation you use to show the details of the
interaction.
Because have
the most
interactions
is with
sequence
System developers
usedcommon
modelingrepresentation
languages for of
decades
to specify,
visualize,
diagrams,
you
use
the
notation
that's
common
with
such
diagrams.
See
the
specifics
about
construct, and document systems. The Unified Modeling Language (UML) is one of those
other
notations
"Alternate
Interaction
Notations."
languages.
UMLinmakes
it possible
for team
members to collaborate by providing a common

language that applies to a multitude of different systems. Essentially, it enables you to


When using sequence diagram notation, you show a message as a solid line pointing from the
communicate solutions in a consistent, tool-supported language.
sender's lifeline to the receiver's lifeline. If the message is an asynchronous message
(meaning the caller doesn't block waiting for the receiver to process the message), you place
Today, UML has become the standard method for modeling software systems, which means
an open arrowhead on the receiver's end of the line. Figure 10-5 shows an example of an
you're probably confronting this rich and expressive language more than ever before. And
asynchronous message.
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
Figure 10-5. An asynchronous message between objects
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
When returning a book to the library, you typically don't wait around for the librarian to return
the book
to the shelves.
Instead, you drop the book off at the Circulation Desk and continue
Extension
Mechanisms
on your way. The open arrowhead indicates that the caller (AverageJoe) doesn't wait for any
response
theConstraint
CirculationDesk
. (OCL)
Thefrom
Object
Language
Because asynchronous messages don't require the sender to wait for a message to be
delivered, depending on the transport mechanism, asynchronous messages can arrive out of
If you're
to UML,
a network
tutorial with
realistic
has routes
even been
included
to help you
order.
Fornew
example,
two
packets
can examples
take different
to the
same destination,
quickly
yourself
withthe
thefirst.
system.
with
the familiarize
second arriving
before
You can show out-of-order reception by having the
first message point to a spot below the reception point of the second message, as shown in
Figure 10-6.

www.it-ebooks.info

Figure 10-6. Asynchronous messages received out of order


UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
In this example HostMachine sends two ping packets to DestinationMachine. Because of
UML 2.0 differences
in a Nutshellin from
O'Reilly
feelsthe
your
pain. It's
craftedping
for professionals
network
the routes
taken,
response
to been
the second
arrives beforelike
the
you who to
must
create, and understand system artifacts expressed using UML.
response
theread,
first ping.
Furthermore, it's been fully revised to cover version 2.0 of the language.
If a message represents synchronous communication (typically a method call), you place a
filled
head on the
end.
You
can show
return values from
a UML
method
a
This arrow
comprehensive
newreceiver's
edition not
only
provides
a quick-reference
to all
2.0 using
diagram
dashed
line
with
an open
pointing
to the caller.
Figurealready
10-7 shows
a method
types, it
also
explains
keyarrowhead
concepts in
a way back
that appeals
to readers
familiar
with
call
order
an item andprogramming
a confirmation
number sent back as a return value.
UMLtoor
object-oriented
concepts.
IfTopics
a message
represents object creation, you show a dashed line, with an open arrow pointing
include:
to the newly created object's lifeline. By convention, the message is typically labeled with
some variation of create. If there are no arguments to the message, you can simply label the
Thewith
role the
andkeyword
value of create
UML in projects
message
, as in Figure 10-3. If there are arguments, you show
them as parameters to a create( ) message. If there is a particular reason to show the
The
object-oriented
paradigmlabel
and (such
its relation
to the UML
creation
message
using a different
as a factory
method), you should use that.
Figure 10-8 shows an example that creates an instance of the class UserAccount.
An integrated approach to UML diagrams

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams

Figure 10-7. A method call and the resulting return value

Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Figure 10-8. Showing object instantiation


Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Although this technique isn't mentioned in the specification, some modelers prefer to lower
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
the rectangle representing the object to the end of the message line to clearly indicate the
and Deployment Diagrams
object didn't exist before this creation event. The advantage of this notation is that it clearly
showsExtension
when the Mechanisms
object comes into existence; the disadvantage is that you can't skim the top
row and view the participants. Figure 10-9 shows the same diagram but lowers the newly
created
object.
The
Object Constraint Language (OCL)
UML defines two special types of messages: lost messages and found messages . Lost
messages are messages that are sent but never reach their destination. Found messages are
messages
that to
are
received
by an
object
but the
sender has
is unknown.
For
example,
if youyou
want
If you're new
UML,
a tutorial
with
realistic
examples
even been
included
to help
to
modelfamiliarize
an exception-handling
quickly
yourself with mechanism,
the system. the sending of the exception is really irrelevant
to the mechanism itself, so you can model that as a found message. Understand that
unknown senders and receivers are relative concepts. The sender or receiver of a message
may be unknown as far as a

www.it-ebooks.info

Figure 10-9. Object instantiation with the object lined up with the
creation message
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though
you may
not write UML
diagrams
you'll the
stillscope
need to
particular
interaction
is concerned
, meaning
it'syourself,
really outside
of interpret
what you are
diagrams
written
by
others.
trying to show, not that the message necessarily vanishes from existence (though that's
permissible too).
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
youshow
who must
read,
create,by
and
understand
system from
artifacts
expressed
using than
UML.the
You
a found
message
starting
the message
a black
circle rather
Furthermore,
it's
been
fully
revised
to
cover
version
2.0
of
the
language.
sender's lifeline. Figure 10-10 shows an example of a found message. The CircuitBreaker
doesn't care where the power surge came from; it must terminate the power in all conditions.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

Topics include:

Figure 10-10. An example of a found message

The role and value of UML in projects


The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new
to UML,
a tutorial
with
examples
has evenarrow
been at
included
help rather
you
Similarly,
you show
a lost
message
byrealistic
terminating
the message
a blacktocircle
quickly
familiarize
yourself
with
the
system.
than a receiver's lifeline. Figure 10-11 shows a Workstation sending out a ping message that
for some reason, (network failure) isn't received.

Figure 10-11. An example message being lost

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
10.4. Execution
Occurrences
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
0-596-00795-7
You can show an
object
is involved in executing some type of action (typically a method call)
Pages:
234 of time using an execution occurrence . Execution occurrences are
for a measurable
amount

shown as gray or white rectangles on a lifeline. In practice, it is common to hear execution


occurrences called "focus of control," because they indicate that an object is busy (has the
Table of of
Contents
| Index
focus
the system)
for some period of time. Figure 10-12 shows several execution
occurrences in response to messages.

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages.
UML makes
it possible
for team
membersexecution
to collaborateoccurrences
by providing a common
Figure
10-12.
Several
example
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
While not officially part of the specification, it was a common practice in UML 1.x to show
messages
starting from anparadigm
executionand
occurrence
on to
a lifeline
to indicate that an object will
The object-oriented
its relation
the UML
send messages to other objects as part of processing a received message. With UML 2.0, it
may be
appropriate
to show
a set
of messages as an interaction fragment. Using
Anmore
integrated
approach
to UML
diagrams
interaction fragments, an appropriate interaction operator, and a reasonable name, you have
much Class
greater
flexibility
expressing
exactly how
a piece of Statechart,
the system Activity,
executesComponent,
and how it
and
Object, in
Use
Case, Sequence,
Collaboration,
fits into
theDeployment
bigger picture.
See "Combined Fragments" for more information on interaction
and
Diagrams
fragments and the various ways you can organize messages to increase your diagram's
Extension Mechanisms
readability.
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
10.5. State
Invariants
...............................................
Publisher:O'Reilly
Pub Date: June 2005
0-596-00795-7
UML allows you ISBN:
to place
labels along a lifeline to convey conditions that must be true for the
Pages:
234
remainder of the
interaction
to be valid. These conditions are called state invariants . State

invariants are typically boolean expressions, though they may be full UML states (see Chapter
8). For example, you may have a series of messages that initialize a participant. After the
Table of Contents
| Index
messages
have
completed, the participant must be in a well-known state for the remainder of
the interaction to complete successfully. You can enforce that by placing a state invariant on
your diagram after the initialization messages.
System developers have used modeling languages for decades to specify, visualize,
You
show aand
boolean
state invariant
placing
the Language
conditional(UML)
insideiscurly
braces
construct,
document
systems. by
Thesimply
Unified
Modeling
one of
those({})
on
the lifeline
of the
object
you want
check.
The invariant
will be evaluated
after
any
languages.
UML
makes
it possible
fortoteam
members
to collaborate
by providing
a common
messages
it on the diagram.
Figure
10-13Essentially,
shows a basic
boolean
invariant
language that
that come
appliesabove
to a multitude
of different
systems.
it enables
you
to
checking
that an
Accountinhas
been authenticated
successfully.
communicate
solutions
a consistent,
tool-supported
language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
Figure
10-13.
state
ensuring
thatstill
the
account
is in the
even
though
you mayAnot
writeinvariant
UML diagrams
yourself, you'll
need
to interpret
diagrams written by others.
proper state before continuing
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
You show an invariant as a UML state by simply drawing the state symbol (rectangle with
Thesides)
Object
Constraint
Language
(OCL)
rounded
over
the appropriate
part
of the lifeline of the object you want to check. The
actual information that is validated by the state can be expressed using the normal UML state
diagram notation. Figure 10-14 shows the same Account authentication using a UML state.
If you're
new
tutorial
realistic
examples inside
has even
been
included
to help
you
UML
allows
youtotoUML,
placea the
statewith
invariant
information
a note
and
link it back
to the
quickly
familiarize
yourself
with
the
system.
lifeline, though this doesn't tend to be as obvious to the reader as seeing a constraint directly
on the lifeline in the proper sequence. Figure 10-15 shows a state invariant using a note.

Figure 10-14. A state invariant using a real UML state

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
Figure 10-15. A state invariant using a note; authenticated must be
languages. UML makes it possible for team members to collaborate by providing a common
when setPhoneNumber
is called
language that appliestrue
to a multitude
of different systems. Essentially,
it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
10.6. Event
Occurrences
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
0-596-00795-7
Event occurrences
are
the smallest building blocks of interaction diagrams; they represent
Pages:
234
moments in time
when
something happens. Sending and receiving a message are the most

common types of event occurrences, though technically they can be any action associated
with an object. For example, if object1 sends a message to object2, there are two event
Table of Contents |aIndex
occurrences,
message send and a message receive . UML carefully defines interaction
fragments as a set of event occurrences where ordering is significant because they represent
events over time.
System developers have used modeling languages for decades to specify, visualize,
Each
type of
interaction
diagram
notation
(sequence,
communication,
etc.)ishas
way
of
construct,
and
document
systems.
The Unified
Modeling
Language (UML)
oneaof
those
expressing
time-sensitive
nature
the event
occurrences.
In a sequence
diagram
the
languages.the
UML
makes it possible
forofteam
members
to collaborate
by providing
a common
event
occurrences
are ordered
along the
lifelines systems.
and are read
from topitto
bottom.
Figure
language
that applies
to a multitude
of different
Essentially,
enables
you
to 1016
shows a sequence
diagram
with threetool-supported
of the event occurrences
communicate
solutions
in a consistent,
language. labeled (as mentioned
earlier, any action associated with an object is an event occurrence, but to keep the diagram
from
getting
controlthe
only
three are
labeled
the figure).
Today,
UML out
has of
become
standard
method
forinmodeling
software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.

Figure 10-16. A sequence diagram with three event occurrences


UML 2.0 in a Nutshell from O'Reilly feels your
pain. It's been crafted for professionals like
labeled
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
10.7. Traces
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:as
0-596-00795-7
UML defines a trace
a sequence of event occurrences. The term trace is used when
Pages:
234occurrences and how they may be combined. Interaction diagrams
discussing sets of
event

allow you to combine fragments in such a way that the event occurrences are interleaved.
This combined set of event occurrences is considered a new trace.
Table of Contents | Index

Throughout this chapter we will refer to a sequence of event occurrences as event


occurrences rather than as a trace to try and reduce the number of keywords.
System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
10.8. Combined
Fragments
...............................................
Publisher:O'Reilly
Date:
June
Often there are Pub
times
when
a 2005
particular sequence of event occurrences has special constraints
ISBN:
0-596-00795-7
or properties. For
example,
you may have a critical region within your interaction where a set
of method calls Pages:
must 234
execute atomically, or a loop that iterates over a collection. UML calls
these smaller pieces interaction fragments .
Table of Contentsfragments
| Index
Interaction
by themselves aren't terribly interesting, however UML allows you to
place them in a container called a combined fragment (it's called a combined fragment even if
you have only one interaction fragment in there). Once they are placed in such a container,
UML
allows
you to specify
additional
detail
for each fragment,
orto
how
several
fragments relate
System
developers
have used
modeling
languages
for decades
specify,
visualize,
to
each other.
construct,
and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
Each
combined
fragment
made up of
interaction
operator
and oneitor
more interaction
language
that applies
to is
a multitude
of an
different
systems.
Essentially,
enables
you to
fragments,
which
are theininteraction
operands
. An interaction
operator specifies how the
communicate
solutions
a consistent,
tool-supported
language.
interaction operands should be interpreted. The various interaction operators are described in
detail
later
inhas
thisbecome
chapter.the standard method for modeling software systems, which means
Today,
UML
you're probably confronting this rich and expressive language more than ever before. And
As
youthough
do withyou
fullmay
interactions,
a combined
fragment
as need
a rectangle,
with the
even
not write you
UMLshow
diagrams
yourself,
you'll still
to interpret
interaction
operator
in
a
pentagon
in
the
upper
left
and
the
interaction
operands
inside the
diagrams written by others.
rectangle.Figure 10-17 shows a combined fragment representing a critical section of code.
The
must
be executed
atomically
because
of the
interaction
operand
critical. This
UMLcode
2.0 in
a Nutshell
from O'Reilly
feels
your pain.
It's
been crafted
for professionals
likeand
other
interaction
operators
described
in "Interaction
Operators."
you who
must read,
create,are
and
understand
system artifacts
expressed using UML.

Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
Figure
10-17.
An
combined
fragment
types, it also explains
key
concepts
in aexample
way that appeals
to readers
already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.
Depending on the interaction operator you choose for a combined fragment, you may need to
specify multiple operands. You separate operands using a horizontal dashed line across the
rectangle. Messages aren't permitted to cross between interaction fragments. The order of the
operands is significant for some of the operators, so always read a combined fragment from

www.it-ebooks.info

top to bottom. See Figure 10-18 for an example of multiple operands.

UML 2.0 in a Nutshell

10.8.1. Guard
Conditions
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
An interaction fragment
Pub Date: may
June have
2005 a guard condition that states when the fragment is valid
(can be executed);
as
in
an
"if-then"
ISBN:0-596-00795-7 condition. The syntax for a guard condition is simply:
Pages:234

[ boolean_expression

Table of Contents | Index

You show a guard condition directly above the first event occurrence in the relevant
interaction fragment and on top of the associated lifeline. A guard condition can refer to any
System
have
modeling
languages
for decades
toto
specify,
visualize,
local
datadevelopers
available to
thatused
lifeline,
or to any
global data
available
the overall
interaction; it
construct,
and
document
Unified
Modeling
Language
(UML)
is one ofof
those
can't
refer to
the
local datasystems.
of some The
other
lifeline.
Figure 10-18
shows
an example
an
languages.interaction
UML makes
it possible
team members
collaborate by providing a common
alternative
operator
thatfor
models
an if-elsetocondition.
language that applies to a multitude of different systems. Essentially, it enables you to
communicate
solutions
in a consistent,
tool-supported
See
the description
for each
interaction operator
to see language.
when guard conditions are necessary
and how they are used. If you don't place a guard condition before an interaction fragment, it
UML has
the standard
for modeling
software
systems, which means
isToday,
interpreted
as abecome
guard condition
that method
always evaluates
to true
.
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.

10.8.2. Interaction Operators

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Each
interaction
defined
in the
UML 2.0
specification
explained in detail in the
Furthermore,
it'soperator
been fully
revised
to cover
version
2.0 of theis language.
following sections. Each operator has an associated number of operands and a keyword that is
placed
in the pentagon
of edition
a combined
fragment.
This comprehensive
new
not only
provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

10.8.2.1. Alternatives
Topics include:
Alternates are a choice of the behavior that executes based on guard conditions placed before
each operand. The interaction operator is alt. You may include an else guard condition that
The role and value of UML in projects
executes the associated operand when the other conditions are false.Figure 10-18 shows
this. The object-oriented paradigm and its relation to the UML

An integrated approach to UML diagrams

Figure
Example
alternative
operator
Class and Object,
Use10-18.
Case, Sequence,
Collaboration,
Statechart,
Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though
you may not write UML diagrams yourself, you'll still need to interpret
10.8.2.2.
Option
diagrams written by others.
Options
fragments
that
executes
onlyIt's
if the
guard
condition
is TRue. Thelike
UML 2.0are
in ainteraction
Nutshell from
O'Reilly
feels
your pain.
been
crafted
for professionals
interaction
operator
opt. Conceptually,
options
are artifacts
similar toexpressed
an alt operator
with only one
you who must
read,iscreate,
and understand
system
using UML.
operand.
Figure
10-19
shows
an
option
operator.
Furthermore, it's been fully revised to cover version 2.0 of the language.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram

10.8.2.3.
Break
types, it also
explains key concepts in a way that appeals to readers already familiar with

UML or object-oriented programming concepts.


Abreak indicates that the associated interaction fragment operand should execute and then
Topics include:
terminate
the enclosing interaction. The interaction operator is break. A break is similar to the
following code block:
The role and value of UML in projects
if (guardCondition) { ... ; return; }
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams

Figure
10-19.
Example
optionStatechart,
operator
Class and Object,
Use Case,
Sequence,
Collaboration,
Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate
solutions
in a operator.
consistent, tool-supported language.
Figure
10-20 shows
a break
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may
not write
UML diagrams
yourself,
you'lloperator
still need to interpret
Figure
10-20.
Example
break
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms

10.8.2.4. Parallel
The Object Constraint Language (OCL)
Parallel indicates that the associated interaction fragments may be merged and executed in
parallel. The interaction operator is par. UML specifies that the actual interleaving of the event
If you're new to UML, a tutorial with realistic examples has even been included to help you
occurrences of the operands must be done in such a way that the ordering in the original
quickly familiarize yourself with the system.
operand is maintained. For example, if the first operand consists of:
Step1
Step2
Step3

www.it-ebooks.info

and the second consists of:


UML 2.0 in a Nutshell

StepA
StepB
StepC

ByDan Pilone,Neil Pitman


...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

they can be merged into:


Table of Contents | Index

Step1
StepA
StepB
System
developers have used modeling languages for decades to specify, visualize,
Step2
construct,
StepC and document systems. The Unified Modeling Language (UML) is one of those
languages.
Step3 UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

but not into:


Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
evenStep1
though you may not write UML diagrams yourself, you'll still need to interpret
StepBwritten by others.
diagrams
Step2
UMLStepA
2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you Step3
who must read, create, and understand system artifacts expressed using UML.
StepC
Furthermore,
it's been fully revised to cover version 2.0 of the language.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
because
stepBkey
would
be executed
out
of appeals
order. Figure
10-21already
shows an
example
types, itstepA
also and
explains
concepts
in a way
that
to readers
familiar
withof
the
parallel
operator to model
a desktop
login sequence.
UML
or object-oriented
programming
concepts.
Topics include:

Figure 10-21. Example parallel operator

The role and value of UML in projects

The object-oriented paradigm and its relation to the UML


An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
maythat
not write
UML diagrams
yourself, you'll
still need
to interpret
Ifeven
you though
need toyou
convey
a particular
event occurrence
must come
before
another event
diagrams
written
by
others.
occurrence, UML has an explicit notation called a general ordering. You can show a general
ordering anywhere in an interaction diagram, but it must connect two event occurrences. You
UML 2.0
in aaNutshell
from
O'Reillythe
feels
pain.
It's been crafted
professionals
simply
draw
dotted line
between
twoyour
event
occurrences,
with a for
solid
arrow in thelike
middle
you
read,
create,
and
understand
system
artifactssecond.
expressed
UML.if you don't
of
thewho
linemust
pointing
toward
the
occurrence
that
must happen
For using
example,
Furthermore,
been
fully revised
to10-21
cover to
version
2.0 ofuntil
the all
language.
want
the login it's
splash
screen
in Figure
be hidden
the applications are started,
you can indicate that the startUserLoginApps( ) call must occur before the
This comprehensive new)edition
not only
provides
quick-reference
to allordering
UML 2.0todiagram
hideLoginSplashScreen(
call. Figure
10-22
showsahow
to use a general
indicate
types,
also explains
key concepts
in a way
that appeals to readers already familiar with
that
theitapplication
startup
must complete
first.
UML or object-oriented programming concepts.
Topics include:

Figure 10-22. Example general ordering


The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams Weak
writtensequencing
by others.
10.8.2.5.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who
must read,
create,that
andthe
understand
system artifacts
using
Weak
sequencing
indicates
event occurrences
in eachexpressed
operand can
be UML.
interleaved
Furthermore,
it's
been
fully
revised
to
cover
version
2.0
of
the
language.
according to the following rules:
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML
or object-oriented
concepts.
1. The
ordering of theprogramming
event occurrences
within each operand is maintained. For example,
if the first operand has <step1, step2, step3> and the second operand is <stepA,
Topics
include:
stepB,
stepC>, they may be interleaved to <step1, stepA, step2, stepB, step3, stepC>
because the order is maintained, but not to <step1, step3, stepA, step2, stepB,
stepC> because the ordering of the event occurrences in the first operand is changed.
The role and value of UML in projects
2. If event occurrences in different operands occur on different lifelines, they can be
The object-oriented
paradigm and its relation to the UML
interleaved
in any order.
integrated
approach
to UML diagrams
3. IfAn
event
occurrences
in different
operands occur on the same lifeline, they can be
interleaved only in such a way that the event occurrences of the first operand execute
Class and
Object, Use Case,
Collaboration, Statechart, Activity, Component,
before
the occurrences
of the Sequence,
second operand.
and Deployment Diagrams
The interaction operator is seq. For Figure 10-22, a weak sequencing wouldn't change the way
Extension
Mechanisms
the calls
are interleaved
because the first operand has calls only to DesktopService and the
second operand has calls only to the ApplicationService. However, if the sequence is
The Object Constraint Language (OCL)
changed so that the second operand includes a call to the DesktopService, it isn't allowed to
execute until all the calls to DesktopService in the first operand are complete (Rule #3).
Figure 10-23 shows this new sequence diagram.

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

Figure 10-23. Example of a weak sequencing operator

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams Strict
writtensequencing
by others.
10.8.2.6.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who
must read,
create,
andthe
understand
system
artifacts
expressed
using UML.across
Strict
sequencing
indicates
that
ordering of
the event
occurrences
is significant
Furthermore,
it's
been
fully
revised
to
cover
version
2.0
of
the
language.
lifelines, not just within the same lifeline (as with weak sequencing). The operands of a strict
sequence must be executed in order, from top to bottom. The interaction operator is strict.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.

10.8.2.7. Negative

Topics include:
Negative indicates a set of event occurrences that are considered invalid, meaning the
interaction can never execute this particular path. The interaction operator is neg. This
The operator
role and value
of UML
projects
particular
is rarely
usedin
but
can convey that the particular sequence isn't permitted.
Figure 10-24 shows an example of an invalid call to a Graphics2D object. In this diagram, a
The indicates
object-oriented
paradigm
relation sequence
to the UMLis invalid.
UML note
to the reader
whyand
theits
particular
An integrated approach to UML diagrams

10.8.2.8.
Critical
region
Class
and Object,
Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Acritical region indicates that the given event occurrences must be treated as an atomic
Mechanisms
block. Extension
The interaction
operator is critical. Critical regions are typically used inside other
interaction fragments (such as a parallel fragment) to ensure that a group of event
The Object
Language (OCL)
occurrences
can't Constraint
be separated.
Figure 10-25 shows an example rendering engine loop that checks to see if map data is
available for drawing. Because loading map data may be an expensive operation, we'll allow
If you're
new
to UML,
a tutorial
with realistic
even been
included to
help
you
the
loading
to be
executed
in parallel
with theexamples
rendering.has
However,
compressed
map
data
quickly
familiarize
yourself
with
the
system.
can't be rendered, so the loading and decompression must occur as an atomic operation.

Figure 10-24. Example of a negative operator

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Figure 10-25. Example of a critical region operator

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
BecauseFigure 10-25 needs to represent a continuously running process (the rendering
loop), Extension
it's better Mechanisms
to model the looping conditions with the loop operator shown later in this
chapter (see "Loop").
The Object Constraint Language (OCL)

10.8.2.9. Ignore/consider
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.
Ignore specifies a set of messages that aren't shown on the interaction fragment and can be
safely ignored. This typically implies that the ignored messages are irrelevant for the purpose
of the diagram; however, they may still occur during actual execution. The interaction
operator is ignore, and the syntax is:

www.it-ebooks.info

ignore { messagename ,messagename ,... }

UML 2.0 in a Nutshell


Figure 10-26 shows
an example of the ignore operator that models a simple mail
ByDan Pilone,
Neil Pitman
transmission protocol.
In this
sequence, ping and status messages are explicitly ignored. This
means they can...............................................
occur anywhere during this sequence and should be handled by the system,
Publisher:
but are irrelevant
to theO'Reilly
flow of execution we're trying to model.
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Figure 10-26. Example of an ignore operator


Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented
programming
concepts.
Consider
specifies a set of
messages that
are explicitly relevant to the diagram, so you can
safely ignore any other message. The interaction operator is consider, and the syntax is:
Topics include:
consider { messagename ,messagename ,... }
The role and value of UML in projects

object-oriented
paradigm
and its relation
to the as
UML
FigureThe
10-27
shows the same
mail transmission
sequence
that shown in Figure 10-26 but
explicitly considers authenticateUser,sendEnvelope,sendBody,disconnect,shutdown, and
An integrated approach to UML diagrams
reset. Because shutdown and reset aren't shown on the sequence diagram, it's invalid for
either message to occur during execution.
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams

10.8.2.10.
Assertion
Extension
Mechanisms
The Object Constraint Language (OCL)
Anassertion indicates that the contained event occurrences are the only valid execution path.
The interaction operator is assert. Assertions are typically combined with some kind of state
invariant to enforce a state of a system.
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly10-28
familiarize
with diagram
the system.
Figure
showsyourself
a sequence
in which the user requests that maps be redrawn.
TheRenderingEngine instructs the DrawingSurface to remove all the existing textures, and the
assertion guarantees there are no textures left.

10.8.2.11. Loop

www.it-ebooks.info

Aloop indicates that the contained event occurrences are to be executed some number of
UML 2.0 in
a Nutshellis loop. The notation for a loop includes a minimum and
times. The interaction
operator
ByDan
maximum number
of Pilone,
timesNeil
a Pitman
loop should execute. You
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
0-596-00795-7
Figure
10-27. Example
Pages:234

of a consider operator

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:

Figure 10-28. Example of an assertion operator

The role and value of UML in projects


The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.
may also use a guard condition that is evaluated each time through the loop to terminate
execution. The syntax for the operator is:
loop (min,max)

www.it-ebooks.info

where both min and max are optional. If max is excluded, max equals min.max may be an
UML 2.0 inan
a Nutshell
asterisk (*) to indicate
infinite loop (or at least while the guard condition evaluates to
ByDan
true). If both min
andPilone,
max Neil
arePitman
excluded, min equals 0, and max equals infinity; in this case
you likely want ...............................................
to have a guard condition to prevent the loop from executing indefinitely.
Publisher:O'Reilly
Pub Date:
June 2005 loop modeled in Figure 10-25. In this sequence diagram,
Figure 10-29 shows
the rendering
ISBN:0-596-00795-7
the looping is explicitly
shown with a guard condition that will terminate the loop when the
user has set thePages:
quit 234
flag to be TRue. There is also an inner loop that instructs the MapLoader
to execute while there are maps to load.
Table of Contents | Index

Figure 10-29. Example of a loop operator


System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
10.9. Interaction
Occurrences
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Aninteraction occurrence
is shorthand for copying one interaction into another, larger interaction. For
Pages:
234 an interaction that simply shows user authentication and then reference it (create
example, you can
create

an interaction occurrence) in larger, more complete interaction diagrams.

Table of
Contentsfor
| Index
The
syntax
an interaction occurrence is a combined fragment rectangle with the interaction operator ref
Place the name of the referenced interaction in the rectangle. UML allows parameters to be passed to
referenced interactions using the following syntax:
System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages.
UML makes
possible for team members.interaction_name
to collaborate by providing
a common
attribute_name
= itcollaboration_occurrence
( arguments
) : return_value
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

where:
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
attribute_name

UML 2.0
in aoptional
Nutshellpart
from
O'Reilly
feels
your
pain. It's
been
crafted
forreturn
professionals
like be applied to.
Is an
of the
syntax
that
specifies
what
attribute
the
value should
you who
read,
create,
and
understand
artifacts
expressed
using UML.
The must
attribute
must
be an
attribute
of a system
lifeline in
the larger
interaction.
Furthermore, it's been fully revised to cover version 2.0 of the language.
collaboration_occurrence
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram

types, it also explains key concepts in a way that appeals to readers already familiar with
Is object-oriented
an optional scoping
of the referenced
interaction if it is part of a larger collaboration.
UML or
programming
concepts.
Topics include:

interaction_name

Is
the
name
the of
interaction
to copy.
The
role
and of
value
UML in projects

The object-oriented paradigm and its relation to the UML


arguments

An integrated approach to UML diagrams


Is a comma-separated list of arguments to pass to the referenced interaction. The arguments may be
values
or parameter
If only argument
values are
used, arguments
matched against the
Class and
Object, Usenames.
Case, Sequence,
Collaboration,
Statechart,
Activity, are
Component,
interaction
parameters,
in order. If you want to skip an argument, you place a dash (-) where the
and Deployment
Diagrams
argument would be. Skipped arguments have unknown values. You may explicitly identify a paramete
Extension
Mechanisms
name
by following
its text name with a colon (:) and then the value. If you use parameter names, you
may omit arguments not relevant to the interaction. As with a dash, skipped arguments have unknow
The Object Constraint Language (OCL)
values.
You may prefix an argument with the keyword out or inout to indicate that the argument is used to
return a value. If the argument is used as an out argument, a value after the colon in the argument
If you're
new to UML,
a tutorial with
examples
specification
is interpreted
to berealistic
the return
value. has even been included to help you
quickly familiarize yourself with the system.
return_value

Is an optional part of the reference that, if present, indicates the value returned by the copied
interaction.

www.it-ebooks.info

Figure 10-30 shows a simple mail transmission sequence diagram that uses an interaction occurrence to
refer to another sequence diagram that illustrates user authentication. In this example, the return value
from the interaction occurrence is ignored, so it isn't assigned to any variable.
UML 2.0 in a Nutshell

ByDan Pilone,Neil Pitman


...............................................
Publisher:O'Reilly
Figure 10-30. Example
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

of an interaction occurrence

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
10.10. Decomposition
...............................................
Publisher:O'Reilly
Pub Date: June 2005
0-596-00795-7
A participant in ISBN:
an interaction
diagram may be a complex element in and of itself. UML allows
Pages:234
you to link interaction
diagrams by creating a part decomposition reference from a participant

to a separate diagram. For example, you may have a Purchase Item interaction diagram that
has a participant execute a credit card authorization. The actual details of the authorization
Table of Contents
| Index
process
are probably
not of interest to the readers of your Purchase Item diagram; however,
they are vitally important to the developers responsible for the authorization subsystem. To
help reduce clutter on your diagrams, you can create a separate diagram showing how the
authorization
subsystem
credit cards
and place
a decomposition
System developers
havevalidates
used modeling
languages
for decades
to specify,reference
visualize,to that on
the
Purchaseand
Item
diagram.systems. The Unified Modeling Language (UML) is one of those
construct,
document
languages. UML makes it possible for team members to collaborate by providing a common
To
create athat
partapplies
decomposition
reference,
simply systems.
place refEssentially,
interaction_diagram_name
language
to a multitude
of different
it enables you toafter
the
instance name
in theinhead
of your lifeline.
Figure 10-31
shows how the Purchase Item and
communicate
solutions
a consistent,
tool-supported
language.
authorization diagrams can be modeled.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
Figure
10-31. Example of a decomposition diagram
diagrams written
by others.

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

Messages that come into or out of the decomposed lifeline are treated as gates that must be
matched by corresponding gates on the decomposition. A gate represents a point where a
message crosses the boundary between the immediate interaction fragment and the outside
UML 2.0 in a Nutshell
environment. A gate has no symbol of its own; you simply show a message pointing to the
ByDan Pilone,Neil Pitman
edge of the frame
of an interaction fragment. The entire purpose of a gate is to show an
object that sent...............................................
a message connecting to the object that received the message.
Publisher:O'Reilly

Pub Date:
2005 on the direction (in or out) and the message in question.
By default, a gate's
nameJune
is based
ISBN:0-596-00795-7
For example, a gate showing a message named verifyPayment leaving an interaction
Pages:234
fragment is named out_verifyPayment. However, you may explicitly name gates if that adds
readability to your diagram.
Table of Contents | Index
If
the messages shown in the decomposition are part of a combined fragment in the larger
interaction diagram, the decomposition must inherit the same interaction operand. UML
defines this as extra-global . For example, if the larger interaction is part of an assert
System developers
used
modeling
languages
for decades
to specify,
visualize,
interaction
operand, have
and the
state
invariant
is declared
on the lifeline
you want
to decompose,
construct,
and document
systems.
Themust
Unified
Modeling
(UML) You
is one
ofshow
those
that
state invariant
(and its
assertion)
apply
to yourLanguage
decomposition.
can
languages. UML
makesfragments
it possibleby
fordrawing
team members
to collaborate
a common
extra-global
combined
the combined
fragmentby
onproviding
your decomposition,
language
to afragment
multituderectangle
of different
systems.
Essentially,
it enables
you to
but
makingthat
theapplies
combined
larger
than your
decomposition
rectangle.
communicate
solutions
in
a
consistent,
tool-supported
language.
Figure 10-32 shows an assertion decomposition of the rendering engine example used earlier
in this chapter.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams
written
by others.
Figure
10-32.
Example of a decomposition with extra-global

fragments

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The UML specification recommends that you name your decomposition diagrams using an
The object-oriented
and its relation
to the
abbreviation
for the objectparadigm
being decomposed,
followed
by UML
an underscore (_), followed by the
name of the interaction. For example, if you are modeling a credit card authorization system
An integrated approach to UML diagrams
and want to show how a card is validated, you can name your decomposition
CCAS_Validation
.
Class and Object,
Use Case, Sequence, Collaboration, Statechart, Activity, Component,

and Deployment Diagrams


You can also show decompositions inline by showing parts of the decomposed element
attached
as smaller
rectangles to the bottom of the head of the lifeline. Each part gets its own
Extension
Mechanisms
lifeline. This can be useful to show inner classes receiving or sending messages. For example,
it is common
practice
in JavaLanguage
to declare(OCL)
an inner anonymous class to handle GUI events. If
The Object
Constraint
you felt this was relevant to your interaction you can show this level of detail on the main
interaction diagram. However, inline notation is relatively uncommon because decompositions
are typically used to show a complex, subinteraction that would clutter the top-level diagram.
If you're new to UML, a tutorial with realistic examples has even been included to help you
Figure
showsyourself
an example
part decomposition where MainWindow has two inner
quickly10-33
familiarize
with inline
the system.
classes: an anonymous WindowListener and an instance of an EventHandler named
mEventHldr.

www.it-ebooks.info

Figure 10-33. Example of an inline decomposition


UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
10.11. Continuations
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
0-596-00795-7
Typically used with
interaction
references, continuations allow you to define different
Pages:234 interaction outside of the alternative itself. Continuations are
branches of an alternative

conceptually similar to named blocks of functionality.


Table of
Contents |for
Index
The
notation
continuations can be particularly confusing. You show a continuation using
the symbol for states, a rectangle with rounded sides; however, the position of the rectangle
changes the meaning of the diagram. You place a continuation at the beginning of an
interaction
to define have
the behavior
for thatlanguages
continuation.
You use to
a continuation
by showing the
System developers
used modeling
for decades
specify, visualize,
rectangle
at
the
end
of
an
interaction.
Finally,
continuations
with
the
same
name
must
cover
construct, and document systems. The Unified Modeling Language (UML) is one of
those
the
same lifelines
(and only
those lifelines).
languages.
UML makes
it possible
for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
Figure
10-34 shows
the in
first
of three sequence
diagrams
demonstrating a continuation; this
communicate
solutions
a consistent,
tool-supported
language.
one displays the details of a Login sequence. After the password is retrieved from the
database,
an has
alternative
is entered.
If the
passwords
match,
variouswhich
flags are
set
Today, UML
becomeinteraction
the standard
method for
modeling
software
systems,
means
on
the UserCredentials
. Afterthis
setting
the flags,
there language
is a continuation
named
success
you're
probably confronting
rich and
expressive
more than
everLogin
before.
And ,
in
which
usersyou
of this
can plug
in theiryou'll
own functionality.
If the passwords
even
though
maysequence
not writediagram
UML diagrams
yourself,
still need to interpret
don't
match,
the
else
part
of
the
alternative
interaction
executes,
which
leads
to the Login
diagrams written by others.
failed continuation. Notice the continuation symbols are at the end of each interaction
operand,
indicating
thisfrom
diagram
uses
an externally
continuation.
UML 2.0 in
a Nutshell
O'Reilly
feels
your pain. defined
It's been
crafted for professionals like

you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

Figure 10-34.
Using
a only
continuation
in a sequence
diagram
This comprehensive
new edition
not
provides a quick-reference
to all UML
2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
Figure 10-35 shows the second diagram, a sequence diagram that makes use of the Login
sequence and defines continuations for Login success and Login failed. If the correct
The role and value of UML in projects
password was entered, the Login success continuation is executed; otherwise, the Login
failed continuation is run. Notice in this diagram that the continuation symbols are at the top
The object-oriented paradigm and its relation to the UML
of the interaction, indicating that this diagram defines the behavior to execute.
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
Figure
10-35.
Defining continuations in a sequence diagram
and
Deployment
Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who
must read,
and understand
systemtoartifacts
expressed using UML.
Taken
together,
thesecreate,
two diagrams
are equivalent
Figure 10-36.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
10.12. Sequence
Timing
...............................................
Publisher:O'Reilly
Pub Date: June 2005
0-596-00795-7
UML provides a ISBN:
notation
to capture a specific time associated with an event occurrence. You
Pages:horizontal
234
simply place a small
line next to an event occurrence to capture the time of the

occurrence, or place a timing constraint on it. Typically, you use a variable to capture a
specific instance in time and then represent constraints as offsets from that time. Constraints
Table expressed
of Contents | Index
are
like state invariants and placed next to the event occurrence.
For example, if you want to express that a credit card authorization system must return
approval
or denial within
seconds oflanguages
placing the
can place
time constraints
System developers
have three
used modeling
forrequest,
decadesyou
to specify,
visualize,
on
the
event
occurrence,
as
shown
in
Figure
10-37.
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
10.13. Alternate
Interaction Notations
...............................................
Publisher:O'Reilly
Pub Date:
June 2005
UML provides several
notations
for capturing interactions. The first part of this chapter used
ISBN:0-596-00795-7
the sequence diagram
notation. The remainder of this chapter describes the other notations
Pages:
234may be more appropriate than sequence notation.
available and when
they

Table of Contents | Index

Figure 10-36. The final sequence, with all continuations expanded


System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new
to UML, a tutorial with
realistic examples has even been included to help you
10.13.1.
Communication
Diagrams
quickly familiarize yourself with the system.

Communication diagrams allow you to focus on the elements involved in interactions rather
than the detailed sequencing and flow control allowed in sequence diagrams. Most UML tools
can automatically convert from a sequence diagram to a communication diagram; however,
because communication diagrams aren't as expressive,.some information may be lost.

www.it-ebooks.info

When you're modeling with communication diagrams, objects are represented by a rectangle,
and connections between objects are shown as a solid line. Each message has a sequence
number and a small
arrow
indicating the direction of the message along a given connection.
UML 2.0
in a Nutshell
Communication By
diagrams
can't
show message overtaking (see Figure 10-6 earlier in the
Dan Pilone,Neil Pitman
chapter) or interaction fragments.
...............................................
Publisher:O'Reilly
Figure 10-38 shows a simple sequence diagram and the equivalent communication diagram.
Pub Date: June 2005
ISBN:0-596-00795-7
The syntax for a message name is:
Pages:234

Table of
Contents | Index
sequence_number:

name [ recurrence_or_guard

System developers have used modeling languages for decades to specify, visualize,
construct,
document
systems. The
Unified Modeling
Language
(UML)requirements
is one of those
Figure and
10-37.
A sequence
diagram
with hard
timing
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated
approach
to UML
Figure
10-38.
Example
of diagrams
a sequence diagram and its equivalent
communication diagram

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

where:

www.it-ebooks.info

sequence_number
UMLof2.0the
in amessage
Nutshell with 1 being the index of the first message in the diagram.
Is the index
You show By
nested
message
calls by appending the original message number with a
Dan Pilone,
Neil Pitman
decimal and
then starting a new sequence. For example, if the listen( ) call in Figure
...............................................
10-38 makes
a nested
call to startTimer( ), number startTimer( ) as 3.1.
Publisher:
O'Reilly
Pub Date: June 2005

You can show


messages using letters in the sequencing. For example, if the
ISBN:concurrent
0-596-00795-7
ListentingPort
instance
can
support multiple parallel listening calls, the MainWindow
Pages:234
instance can call the listen( ) call twice, labeling the first call as 3a and the second as
3b. Both calls can execute concurrently.
Table of Contents | Index

name

System developers have used modeling languages for decades to specify, visualize,
Is the name of the message being sent (or method call).
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
recurrence_or_guard
communicate solutions in a consistent, tool-supported language.
Is an optional part of the syntax that allows you to specify a boolean condition that
Today,
UMLbe
has
become
standard
software
systems,
which means
must
true
for thethe
message
to method
occur, orfor
a modeling
range of integer
values
for looping.
Guard
you'reconditions
probably are
confronting
this rich
and expressive
language more
ever before. And
represented
as normal
boolean expressions;
for than
example,
even [password.Valid
though you may not
write .UML
yourself,
you'll still
to interpret
== true]
UMLdiagrams
doesn't provide
a syntax
for need
specifying
looping
diagrams
written
by
others.
constraints but does say they must begin with an asterisk (*). For example, you can
represent a loop that executes from 0 to 10 as *[i = 0 .. 10].
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

10.13.2. Interaction Overview Diagrams

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
Interaction
overview diagrams
represent
interactions using a simplification of the activity
UML or object-oriented
programming
concepts.
diagram notation (see Chapter 9). Interaction overview diagrams can help you visualize the
overall
of control through a diagram; however, they don't show detailed message
Topics flow
include:
information.
You can
embed
interactions
or interaction
The
role and
value of UML
in projectsoccurrences inside an interaction overview diagram
if it is helpful to see message details for a subset of the overall interaction.
The object-oriented paradigm and its relation to the UML
Several sequence diagram concepts are supported in interaction overview diagrams:
An integrated approach to UML diagrams
Show
fragments
using
a decision
node and merge
node . Activity, Component,
Class combined
and Object,
Use Case,
Sequence,
Collaboration,
Statechart,
and Deployment Diagrams
Show parallel interactions by using a fork node and join node .
Extension Mechanisms
Show loops as cycles in the activity diagram.
The Object Constraint Language (OCL)
Show names of the lifelines involved in an interaction using the keyword lifelines after
the name of the interaction overview diagram, followed by a comma-delimited list of
each lifeline's name (including any colon separators that may or may not be part of the
If you're
new to UML, a tutorial with realistic examples has even been included to help you
name).
quickly familiarize yourself with the system.
Figure 10-39 is an interaction overview diagram showing a subset of the interaction shown in
Figure 10-36.

10.13.3. Timing Diagrams

www.it-ebooks.info

Timing diagrams are a special representation of interactions that focus on the specific timings
UML
2.0 in a Nutshell
of messages sent
between
objects. You can use timing diagrams to show detailed time
constraints on messages
or
toPitman
show when changes occur within lifelines with respect to time.
ByDan Pilone,
Neil
Timing diagrams...............................................
are most often used with real-time or embedded systems.
Publisher:O'Reilly

Unlike sequencePub
diagrams,
timing
Date: June
2005 diagrams are read left to right rather than top to bottom.
You show a lifeline
name
along the left edge of the diagram. The various states of the lifeline
ISBN:
0-596-00795-7
234by a graphical representation of the transitions between these states.
are then listed, Pages:
followed
Figure 10-40 shows an example of a timing diagram in which the MailServer object
progresses through several states.
Table of Contents | Index

InFigure 10-40, the MailServer starts in the Idle state until the Login event occurs. The
Login event causes the MailServer to transition to Authenticated. When the sendMail event
occurs,
MailServer
transitions
to transmitting
remains there
until disconnected.
Systemthe
developers
have
used modeling
languagesand
for decades
to specify,
visualize,

construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
Figure
10-39.
an interaction
overview diagram
communicate
solutions
in Example
a consistent,of
tool-supported
language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

Figure 10-40. Simple timing diagram

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

When
reading
the diagram
left to
right, you
can usefor
thedecades
length of
timeline
to indicate how
System
developers
have used
modeling
languages
tothe
specify,
visualize,
long
the
object
remains
in
a
particular
state.
To
associate
time
measurements,
show tick
construct, and document systems. The Unified Modeling Language (UML) is oneyou
of those
marks
alongUML
the bottom
part
of thefor
frame,
shown intoFigure
10-41.by providing a common
languages.
makes it
possible
teamas
members
collaborate
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Timing
diagram
with
tick systems,
marks which means
Today, UML hasFigure
become 10-41.
the standard
method
for modeling
software
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
FigureClass
10-41and
shows
thatUse
the Case,
Login Sequence,
event is received
three time
units after
the start
of the
Object,
Collaboration,
Statechart,
Activity,
Component,
sequence.
To show relative
times, you can mark a specific instance in time using a variable
and Deployment
Diagrams
name.Figure 10-41 marks the time the sendMail event is received as time t. You can use
Extension
Mechanisms
relative
time marks
in constraints to indicate that a message must be received within a
specified amount of time. Figure 10-42 shows the Disconnect message must be received
Object
Constraint
Language
(OCL)
within The
10 time
units
of the sendMail
event.
You can show multiple objects involved in a timing diagram by stacking the lifelines. You show
messages between objects using an arrow from one timeline to another. The start and end of
If you're
to UML,to
a when
tutorial
with
realistic
has even This
beennotation
includedshows
to help
you
the
arrow new
correspond
the
message
is examples
sent and received.
the
quickly
familiarize
yourself
with
the
system.
triggers that cause a transition; however it

Figure 10-42. Timing diagram with time constraints

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate
solutions
in a consistent,
language.
very
quickly becomes
unreadable
if a lottool-supported
of messages are
exchanged. Figure 10-43 shows the
MailServer talking with a client, Desktop.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams
by Timing
others. diagram with multiple lifelines and messages
Figure written
10-43.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

UML provides a variation on the timeline notation that simplifies diagrams by showing state
names between two horizontal lines that cross when the state changes. This notation makes it

www.it-ebooks.info

much easier to show multiple objects along a single timeline, but it doesn't show the
messages that trigger transitions. Figure 10-44 shows the MailServer and Client lifelines
progressing through state transitions.
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:Timing
O'Reilly diagram using a simpler timeline notation
Figure 10-44.
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

Chapter 11. Tagged Values, Stereotypes,


and UML Profiles
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

The UML described in the previous chapters allows you to understand any UML model. You
can understand the analysis of a billing system, the implementation model of a CORBA
Table of Contents
| Index system in C++, or an EJB e-commerce system.
system,
a gaming
Practitioners rarely work on such diverse systems at one time, however, and no UML model
will
represent
more than
type
of application.
More
practitioner
(that's you)
System
developers
haveone
used
modeling
languages
for commonly,
decades to a
specify,
visualize,
works
with
colleagues
on
one
system
or
a
series
of
closely
related
systems
exclusively.
For
construct, and document systems. The Unified Modeling Language (UML) is one of those
example,
you
might
design
a seriesfor
of team
gaming
systems,
a series ofby.Net
systems.
And, as
languages.
UML
makes
it possible
members
toor
collaborate
providing
a common
you
might that
expect,
the specific
concerns
a gaming
systemEssentially,
differ profoundly
from
those
language
applies
to a multitude
of of
different
systems.
it enables
you
to of a
.Net
system. solutions in a consistent, tool-supported language.
communicate
UML
allows
to the
create
a dialect
calledfor
a profile
, tailored
to asystems,
specific niche.
Today,
UMLtoolmakers
has become
standard
method
modeling
software
which Within
means a
niche,
stereotype
gives specific
rolesand
to elements,
records
additional
context-specific
you'reaprobably
confronting
this rich
expressiveand
language
more
than ever
before. And
information
inyou
tagged
. Profiles
also include
constraints
even though
mayvalues
not write
UML diagrams
yourself,
you'llthat
still ensure
need tointegrity
interpretof use.

diagrams written by others.


A practitioner familiar with a profile will immediately grasp the meaning of a model developed
using that profile, because of the unique stereotypes. Moreover, the model contains deeper
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
meaning, because of the tagged values, and the model has a higher degree of integrity,
you who must read, create, and understand system artifacts expressed using UML.
because of the constraints. This gives a distinct advantage to practitioners and tools working
Furthermore, it's been fully revised to cover version 2.0 of the language.
in the niche. People and tools unfamiliar with the profile will process it only at a formal level,
without any special understanding.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
Profiles are the standard mechanism to extend UML. The profile mechanism exists within UML
UML or object-oriented programming concepts.
so models applying a profile are fully UML compatible. This contrasts sharply with
implementors' extensions in loosely specified languages such as C++, in which the
Topics include:
specification allows inline assembler and #pragma statements, making it virtually impossible
to port C++ programs between processors or between different compilers. A UML model
applying
profile
UML,of
and
any
tool can process it.
Thea role
andisvalue
UML
in UML
projects
Although
plethora of dialects
can fragment
the universality
of UML, a dialect makes UML
Theaobject-oriented
paradigm
and its relation
to the UML
more useful. And isn't that what it's all about?
An integrated approach to UML diagrams

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
11.1. Modeling
and UML in Context
...............................................
Publisher:O'Reilly
Pub Date: June 2005
0-596-00795-7
Throughout the ISBN:
evolution
of modeling, practitioners, implementors, academics, and other
Pages:
234
interested parties
have
found new and innovative ways to model, and new disciplines to

model. It soon became apparent that the generality of the canonical UML was not concise
enough for practitioners working full time in a particular language, technology, or platform,
Table ofas
Contents
such
ANSII| Index
C++, Struts, or .Net. Moreover, practitioners in similar disciplines, such as
process engineering, with different fundamental structures and constraints found UML
interesting but not quite appropriate. They can better benefit from a UML-like language other
than
UMLdevelopers
itself. Figure
11-1
illustrates
this
situation,for
where
the Meta-Object
Facility (MOF),
System
have
used
modeling
languages
decades
to specify, visualize,
explained
fully later in
the chapter,
comprises
all UML
models (UML)
as wellisas
UML-like
construct,more
and document
systems.
The Unified
Modeling
Language
one
of those
models.
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Today, UML
has become
standard
method
modeling
software
which means
Figure
11-1.the
The
universe
offor
valid
models
in systems,
UML family
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The authors of UML could have specialized UML for common programming languages (such as
The Object Constraint Language (OCL)
C++, C#, Java, and Visual Basic) and platforms (such as embedded systems, real-time
operating systems (RTOS), EJB, and .NET). This would have created an unworkable modeling
language, as each programming language or dialect polluted the specification with conflicting
definitions.
It would
still
extension
mechanism
because
someincluded
"uncommon"
If you're new
to UML,
a require
tutorial an
with
realistic examples
has
even been
to help you
language
(such as Smalltalk)
or new
platform/technique or version (like EJB 3.0) would
quickly familiarize
yourself with
the system.
always be missing from the formal specification.
On the other hand, the authors could have stretched UML to greater abstraction to embrace
uses other than software development, such as business modeling, modeling the process of
software development itself, or modeling systems engineering. This would have made

www.it-ebooks.info

everything even more abstract. Because designers work in only one specific domain,
abstraction impedes concise expression, moving the models further from their domains.
UML 2.0UML
in a Nutshell
Instead of burdening
with complexity, or overwhelming it with abstraction, UML's authors
factored out everything
specific
to domains and platforms. They created the profile extension
ByDan Pilone,
Neil Pitman
mechanism to address
the specific needs of specific application domains. CORBA models, for
...............................................
example, wouldPublisher:
be concise
and precise, but would not influence a .Net model.
O'Reilly
Pub Date: June 2005

Although UML cousins,


such as the Object Management Group's Software Process Engineering
ISBN:0-596-00795-7
Pages:
234
Metamodel (SPEM)
and
SysML.org's Systems Modeling Language (SysML), borrow much
structure from UML, they also discard parts that bring no value to their disciplines. SPEM, best
known as the basis for the Rational Unified Process (RUP), describes the process of software
Table of Contents |in
Index
development
terms of process roles, work products, and activities. Between a software
application and the process of software development, the fundamental structure and
relationships between the parts change. Although much is similar in the statechart, class,
sequence,
package, have
use case,
activitylanguages
diagrams,for
fordecades
example,
is no
implementation
System developers
usedand
modeling
to there
specify,
visualize,
or
component
diagram,
or
interface.
A
profile
specializing
a
few
elements
works,
butthose
it must
construct, and document systems. The Unified Modeling Language (UML) is one of
exclude
or constrain
many
basic concepts.
factorstoout
the structure
of UML itself
for
languages.
UML makes
it possible
for teamMOF
members
collaborate
by providing
a common
reuse
in other
MOF, of
SPEM
and SysML
become
metamodels
at the
same
language
that disciplines.
applies to aUsing
multitude
different
systems.
Essentially,
it enables
you
to level
as
UML. UML remained
to the disciplines
of general
software development, and business
communicate
solutionsclose
in a consistent,
tool-supported
language.
and data modeling. In other disciplines, a new metamodel can be created from adding,
dropping,
andhas
reorganizing
UML
packages
to allow
for a concise
modeling
of thewhich
discipline.
Today, UML
become the
standard
method
for modeling
software
systems,
means
you're probably confronting this rich and expressive language more than ever before. And
More
as seen
in Figure
UML builds
on its core
MOF. MOF can be
evenformally,
though you
may not
write 11-2,
UML diagrams
yourself,
you'llinfrastructure,
still need to interpret
used
by other
modeling
languages for other uses. The core UML can be used as is for building
diagrams
written
by others.
models directly, or it can be constrained by one or more profiles.

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
Each
levelmust
is a level
abstraction.
The levels system
are named
M0, M1,
M2, and
M3, UML.
as they
you who
read,ofcreate,
and understand
artifacts
expressed
using
become
more
abstract.
M0
is
the
concrete
systemthe
code.
M1
is
the
model
of
the
system (of
Furthermore, it's been fully revised to cover version 2.0 of the language.
which M0 is just one realization)the model where designers work. M2 is the language used to
describe
the model, innew
thisedition
case UML
optionally,
the profiles. M3,to
MOF,
is the
This comprehensive
not and,
only provides
a quick-reference
all UML
2.0language
diagram
used
to
describe
UML
and
any
similar
modeling
languages.
MOF
is
far
beyond
the
scope
of this
types, it also explains key concepts in a way that appeals to readers already familiar
with
book.
Suffice
it to say, though,
that MOF
provides a formal infrastructure to UML, which
UML or
object-oriented
programming
concepts.
explains why stereotypes resemble classes and components, and why tagged values resemble
enumerations
and attributes.
Topics include:
The M1 model, specifying your application, may have profiles associated with it. The architect
determines
theand
profiles
according
to the platform, language, and tools available.
The role
valuetoofuse
UML
in projects
Deciding the profile effectively freezes the M2 layer. As an application modeler, you model
classes,
attributes,
states, paradigm
and all the
other
UML elements.
You don't define new stereotypes
The
object-oriented
and
its relation
to the UML
or tagged values. You assign existing stereotypes. You fill in the values appropriate to the
tags. An integrated approach to UML diagrams

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams

Figure 11-2. Layers of abstraction in UML

Extension Mechanisms

The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though
may
not write
yourself,
you'll still reporting,
need to interpret
Unless
you areyou
also
building
yourUML
owndiagrams
tooling for
code generation,
and/or tracking,
diagrams
written
byprofile(s)
others. as is. As a singleton, for example, the class needs certain
you
will employ
the
supplementary information. The code generator needs the same questions answered for every
UML 2.0 in a; Nutshell
O'Reilly
feels your
pain. to
It'shave
beena crafted
for professionals like
singleton
no more, from
no fewer.
It makes
no sense
{multithread-safe=true}
you who
must
create, and understand
system artifacts
tagged
value
forread,
one singleton
if the code generator
doesn'texpressed
recognizeusing
it. If UML.
it does
Furthermore,
it's been
fully revised
to have
coverit.
version
2.0depends
of the language.
recognize
it, every
singleton
should
It really
on the tool.
Some
teams do build new
theiredition
own tooling.
Even
then, a
only
the toolsmithto
works
in the
layer,
This comprehensive
not only
provides
quick-reference
all UML
2.0M2
diagram
and
theitmodelers
work key
in the
M1 layer.
the M2 to
layer
mustalready
be conservative
types,
also explains
concepts
in aChanges
way thatinappeals
readers
familiar with
because
one new taggedprogramming
value in a stereotype
UML or object-oriented
concepts.can imply revisiting tens or hundreds of
elements in the model. Changes in the M2 layer literally change the fundamental meaning of
an
M1 model.
You've been warned.
Topics
include:

The role and value of UML in projects


The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
11.2. Stereotypes
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:the
0-596-00795-7
Stereotypes modify
intent of the elements to which they apply. They allow the
differentiation ofPages:
roles234
of an element within the model. For example, you can quickly

differentiate classes stereotyped as Controller as having a different role in the system than
those stereotyped as View .
Table of Contents | Index

Visually, UML allows graphical and textual representation of a stereotype. Graphics and text
can be combined in various ways for node-type elements, as shown in Figure 11-3. The four
elements
that you see
going
across
the top
of the figure
all represent
the same
combination
System developers
have
used
modeling
languages
for decades
to specify,
visualize,
of
Form
and
key
stereotypes
but
in
different
ways.
Edge-type
elements
have
only
construct, and document systems. The Unified Modeling Language (UML) is one aoftextual
those
representation,
thusityou
see depends
the dependency
between
Billing and
languages. UMLand
makes
possible
for team on
members
to collaborate
by providing
a common
Inventory
language .that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
Figure
11-3. this
Various
stereotypes
you're probably
confronting
rich andrepresentations
expressive language of
more
than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
When displayed as text, a stereotype is enclosed in guillemots (), as in MyStereotype.
Thethe
role
and valuerequire
of UMLan
in extended
projects character set to display correctly, you may also
Because
guillemots
use double angle brackets to show a stereotype in 7-bit ASCII, as in <<MyStereotype>>.
The object-oriented paradigm and its relation to the UML
Graphical icons are neither defined nor standardized by UML. You can expect toolmakers to
An integrated approach to UML diagrams
extend the graphics differently, including coloring or shading, at their discretion. Avoid
graphical symbols for interchange of models between different tools. However, within the
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
controlled environment of a compatible set of tools, specialized graphics and/or colors will
and Deployment Diagrams
likely have more visual impact.

Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

While stereotypes have been around since the initial beta versions of
UML, UML 2.0 has introduced significant changes to the 1.x versions:
UML 2.0 in a Nutshell
ByDanElements
Pilone,Neil Pitman
may have zero, one, or more than one stereotype. The
...............................................
use and usefulness of stereotypes have become more and more
Publisher:
O'Reilly
evident.
More toolmakers have incorporated them into their
Pub Date:
June 2005
products.
Modelers found it impossible to use otherwise
ISBN:0-596-00795-7
complimentary tools because an element can have only one
Pages:234

stereotype.

Stereotypes may be nested. A specialized stereotype can build on


the structure of a general stereotype. In the example provided later
in this chapter, the EJBPrimaryKey stereotype extends the
EJBCmpField stereotype, because all primary keys are ordinary
System developers have
modeling languages for decades to specify, visualize,
fields used
as well.
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes
it possible
members
providing
a common
Tagged
values for
areteam
related
throughtoa collaborate
stereotype by
rather
than directly
language that applies
multitudeThis
of different
systems.
Essentially,
enableswith
youthe
to
to to
thea element.
avoids the
possibility
of nameitclashes
communicate solutions
in a consistent,
tool-supported
introduction
of multiple
stereotypeslanguage.
per element.

Table of Contents | Index

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
You can tag an item in a UML model with more than one stereotype. Figure 11-4 shows
even though you may not write UML diagrams yourself, you'll still need to interpret
multiple stereotypes as a list, with each stereotype enclosed in guillemots.
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Figure 11-4.
A class
and to
ancover
attribute,
with
two
stereotypes each
Furthermore,
it's been
fully revised
version 2.0
of the
language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
11.3. Tagged
Values
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
0-596-00795-7
Having established
an
element's role within a system with a stereotype, the element likely
Pages:
needs information
not234
available from the core UML, to fulfill its role. The stereotype defines a

number of tagged values. Each tagged value is typed with a datatypenumber, string, boolean,
or user-defined enumeration. The upcoming section "UML Profiles" shows one way in which
Table of
Contents
| Index or define, the tagged values that you wish to include in a stereotype.
you
might
record,
When you show them in a diagram, place the tagged values in a note element that is
connected
to the declaring
element
with alanguages
dashed line.
Figure 11-5
shows the
case of multiple
System developers
have used
modeling
for decades
to specify,
visualize,
stereotypes
on
one
element.
To
keep
the
stereotypes
and
the
corresponding
tagged
values
construct, and document systems. The Unified Modeling Language (UML) is one of those
clear,
each stereotype
themembers
tagged are
listedby
separately.
languages.
UML makesisitmentioned,
possible forand
team
to values
collaborate
providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Figure
11-5.
Tagged
values
shown
classified
bysystems,
their owning
Today,
UML has
become
the standard
method
for modeling
software
which means
you're probably confronting this rich and
expressive language more than ever before. And
stereotype
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
At first, you may confuse tagged values with attributes, but they exist at a different level of
The role
and valuedefined
of UMLininthe
projects
abstraction.
Attributes,
design model (M1), exist in the runtime system (M0).
Tagged values, defined in the profile (M2), exist only in the design model (M1). The tagged
paradigm
its relation
to theeither
UML by human or machine. A
valuesThe
mayobject-oriented
provide hints to
help theand
generation
of code,
tagged value of {optimize=space} will probably affect the code ultimately, although the actual
An integrated
approach
to code.
UML diagrams
value itself
never appears
in the

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
11.4. Constraints
...............................................
Publisher:O'Reilly
Pub
Date:
2005 Tagged values provide role-specific information enriching
Stereotypes give
roles
toJune
elements.
ISBN:
0-596-00795-7
the element in its
role.
While atomically the element knows its role and has all the information
Pages:234
to fulfill it, the element
must still interact with its neighbors. The element and their roles must
be in harmony with the architectural vision. The element must also be internally consistent.
Constraints (see "Constraints" in Chapter 2) provide the mechanism to specify rules for
Table of Contents
Index
correct
usage| of
the stereotyped elements.

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


Dan Pilone,Neil Pitman
11.5. UMLBy
Profiles
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
UML profiles combine
the concepts of stereotypes, tagged values, and constraints to provide a
Pages:234
coherent and concise
dialect of UML for a specific family of applications. To make much use of

a profile, some tooling must be provided. The application model drives code or application
generation, so you have little or no control over the stereotypes, tagged values, or constraints
Table of Contentsthe
| Index
comprising
profile. This section discusses the use of existing profiles (as opposed to
defining your own).
Figure
11-6
depicts ahave
partial
UML
profile defining
a stereotype
its associated
tagged
System
developers
used
modeling
languages
for decadeswith
to specify,
visualize,
values
and
a
couple
of
constraints,
as
you
might
receive
in
a
vendor's
documentation.
The
construct, and document systems. The Unified Modeling Language (UML) is one of those
profile
extends
classes
a stereotyped
class,
EJBEntityBean
. It by
extends
attributes
with
languages.
UML
makeswith
it possible
for team
members
to collaborate
providing
a common
two
stereotyped
attributes:
EJBPrimaryKey
and EJBCmpField
. It declares
the respective
language
that applies
to a multitude
of different
systems. Essentially,
it enables
you to
tagged
values for
the stereotyped
classes
and attributes,
and it declares the enumeration,
communicate
solutions
in a consistent,
tool-supported
language.
transactionIsolationLevel, to define the allowable values for the TRansactionAttribute
tagged
Thebecome
profile also
adds the method
constraints
that EJBEntityBean
classeswhich
must means
have
Today, value.
UML has
the standard
for modeling
software systems,
attributes
of typeconfronting
EJBCmpField
. Furthermore,
having these
you're probably
this and
rich EJBPrimaryKey
and expressive language
more attributes
than ever before.
And
stereotypes
exist
an EJBEntityBean
class. From
the profile,
even thoughcan
you
mayonly
not in
write
UML diagrams yourself,
you'llyour
still point
need of
to view,
interpret
along
with written
its constituent
stereotypes and tagged values, is read-only because it tells what
diagrams
by others.
the third-party tool expects in order to do its job.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

Figure 11-6. A partial specification UML profile

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Mechanisms
FigureExtension
11-7 shows
a portion of a model using the profile declared in Figure 11-6.Figure 11-8
indicates how the tagged value structures in the model relate back to the profile declaration.
The Object
Constraint
Language
The notes
containing
the tagged
values(OCL)
make the notation bulky if you need to show a set of
tagged values for every class, attribute, operation, and relationship.
When aiming to expose the structure and relationships of a system, class diagrams rarely
If you're
newvalues.
to UML,
a tutorialagain
with to
realistic
included
to help you
show
tagged
Referring
Figureexamples
11-7, onehas
tinyeven
classbeen
having
two attributes
quickly
familiarize
yourself
with
the
system.
becomes a constellation of four diagram elements. A modest class diagram of 10 classes can
easily require 100 extra notes to show the tagged values, hopelessly confusing the diagram
and destroying its impact. Instead, modelers often maintain the tagged values invisibly in the
model, where tools can extract them as needed.

www.it-ebooks.info

Figure 11-7. A stereotyped class and its stereotyped attributes, with


their respective tagged values
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
Figurewritten
11-8.byThe
partial specification UML profile, showing model
diagrams
others.

elements applying it

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The UML from the profile and the model is shown in Figure 11-8. This illustrates the
relationships
between
the declarations
of the profile and a conforming model. The stereotypes
The Object
Constraint
Language (OCL)
in the profile extend the concept of an element. In this case, the stereotype EJBEntityBean
extends ordinary classes, as shown (1) by the implication of the same element type
(metaclass),Class. In the models applying this profile, only classes may have that
stereotype,
as to
shown
the relationship
(2). Having
established
BillCurrency
an
If you're new
UML,by
a tutorial
with realistic
examples
has even that
beenthe
included
to help is
you
EJBEntityBean
, it yourself
now haswith
all the
tagged values, as shown by the
quickly familiarize
theEJBEntityBean
system.
relationship (3). Stereotypes that extend other stereotypes, as EJBPrimaryKey extends
EJBCmpField, have all the parent's tagged values. Ideally, tooling will aid, enforce, and
validate by making available the correct tagged values and defaults according to the
stereotype's definition. If not, the modeler must rely on discipline.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
11.6. Tools
and How They Use Profiles
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
UML tools use profiles
to provide a spectrum of solutions. Tools providing Model-Driven
Pages:
234
Architecture (MDA)
solutions
have transformations from the Platform-Independent Model

(PIM) to Platform-Specific Model (PSM) and from the PSM to the application. See Appendix A
for a fuller discussion of MDA.
Table of Contents | Index

The OMG conceived the MDA as a vision rather than a specified method. Each vendor has a
different, sometimes radically different, approach to MDA. Consequently, although the
concepts
of the PIM and
PSM
vary greatly
from one
vendor to
any one vendor's
System developers
havethe
used
modeling
languages
for decades
to another,
specify, visualize,
concept
of
the
PIM
and
the
PSM
is
strict
and
concrete.
The
extra
roles
and
information,
construct, and document systems. The Unified Modeling Language (UML) is one of those
introduced
themakes
PIM is it
refined
to the
PSM and
the PSM
code, must
well defined
and
languages.as
UML
possible
for team
members
to to
collaborate
by be
providing
a common
well
controlled.
Profilesto
provide
the definition
of the
information
to be captured
language
that applies
a multitude
of different
systems.
Essentially,
it enablesand
youthe
to
constraints
on solutions
a valid model.
Each tool validates
conformity
to a profile in its own way. The
communicate
in a consistent,
tool-supported
language.
PIM needs only one profile because it can be used and reused for different platforms. Each
PSM,
on UML
the other
hand, potentially
needs
a different
profile software
because each
specific
platform
Today,
has become
the standard
method
for modeling
systems,
which
means
has
different
issues
and transformations
arrive at optimal
code.
you're
probably
confronting
this rich andtoexpressive
language
more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
Tools
previous
to MDA
still use profiles. In general, they provide a model-to-code code
diagrams
written
by others.
generation feature and often a code-to-model reverse engineering feature. To faithfully
generate
runnable
code,
many
details
must
be pain.
stored
in been
the model.
language- like
UML 2.0 in
a Nutshell
from
O'Reilly
feels
your
It's
craftedMany
for professionals
dependent
features
be recorded
in core system
UML. For
example,
UML doesn't
the
you who must
read,can't
create,
and understand
artifacts
expressed
usingrecognize
UML.
Java
keyword strictfp
which
indicates
floating-point
processing.
Without tagged values, a
Furthermore,
it's been,fully
revised
to cover
version 2.0
of the language.
reverse-engineered system would not faithfully reproduce the same code when forward
engineered.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram

types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

Chapter 12. Effective Diagramming

...............................................
Publisher:O'Reilly
Pub Date: June 2005
This chapter illustrates
how you can create effective class diagrams. The diagrams presented
ISBN:0-596-00795-7
in the referencePages:
section
234of this book have few elements. Those diagrams illustrate individual

diagram elements, clear of any clutter; they aren't meant to illustrate diagram types. The
diagrams in the reference section don't represent systems that you will encounter in real life.
This
final
chapter
Table of
Contents
| Indexillustrates some techniques you can use to make real-life diagrams convey
your thoughts more effectively.

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
12.1. Wallpaper
Diagrams
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
0-596-00795-7
The classic novice
class
diagram displays all classes, attributes, operations, relationships, and
Pages:
234
dependencies for
a system.
As the number of classes grows, the diagram becomes huge and

unmanageable. Imprudent reverse engineering drags in clutter. Figure 12-1 diagrams just a
very small part of the Java Abstract Windowing Toolkit (AWT). You will not be able to read the
Table of Contents
| Indexit normally prints as an unwieldy nine pages. You're paying for the paper, so
diagram
because
the diagram is shown here in a greatly condensed form.
Effective
writers convey
language
constructs:
sentences
and visualize,
paragraphs
System developers
haveideas
usedthrough
modeling
languages
for decades
to specify,
organize
text,
details
reinforce
ideas,
and
true
but
irrelevant
facts
are
omitted.
construct, and document systems. The Unified Modeling Language (UML) is oneModelers
of those
desiring
to convey
an ideabe
it a structural
implementation,
languages.
UML makes
it possible
for teamoverview,
members atopattern
collaborate
by providingaadetailed
common
subsystem,
or the
detailed
of of
one
classmust
also use
economy itand
focus.you
Figure
language that
applies
to a context
multitude
different
systems.
Essentially,
enables
to 12-1
has
neither economy
norinfocus.
The diagram
throws a mass
of insignificant detail at readers,
communicate
solutions
a consistent,
tool-supported
language.
leaving the burden of understanding on them. It is a false economy to think that one diagram
can
present
the
information
of a multidimensional
model. software systems, which means
Today,
UMLall
has
become
the standard
method for modeling
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.

Figure 12-1. An overloaded and ineffective class diagram

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension
Mechanisms
12.1.1.
Modeling
Versus Diagramming
The Object Constraint Language (OCL)
Before making Figure 12-1 more effective, let's distinguish modeling from diagramming. The
act of modeling furthers your understanding of the system under study. You use diagrams to
elaborate
the model.
confirmwith
the realistic
model integrity
with
views.
organize
youryou
If you're new
to UML,You
a tutorial
examples
hasnew
even
beenYou
included
to help
understanding.
Youyourself
extend your
quickly familiarize
with knowledge.
the system. You challenge your understanding. By seeing the
known, you can infer, dictate, or investigate the yet to be known. Figure 12-1 might be seen
during modeling, but only as an intermediate step; such diagrams don't demonstrate UML's
true power to communicate.
Diagramming, on the other hand, expresses understanding for the benefit of others. You may

www.it-ebooks.info

be a domain expert by background, or you may have recently synthesized expertise from
modeling with domain experts. You have worked hard to understand, and to put your
understanding into a model, perhaps over weeks or months; now you must make that
UML 2.0 in a Nutshell
understanding immediately
accessible to your readers. Your model should be concise so that
ByDan
Pilone,is
Neil
they understand.
If there
toPitman
be contention, let it be about real ideas, not ambiguity.
...............................................
Diagramming reveals
to others what you discover through modeling
.
Publisher:O'Reilly
Pub
Date: June
It doesn't matter
whether
you2005
formally create a model in a modeling tool, whether the model
ISBN:
0-596-00795-7
is implicitly in your
head,
or whether the model resides in another form: each diagram drawn
234
from that modelPages:
should
express one or a very limited number of related concepts. You choose
the idea to express, and you express it from the elements in the model. Presenting your ideas
in UML requires multiple diagrams, just as writing a section in this chapter requires multiple
Table of Contents | Index
paragraphs.

Implicitly, you may think that discussions of layout and effective diagrams relate only to
human-drawn
diagrams.
utilities
create one-way
transformations
to UML of
System developers
haveAutomated
used modeling
languages
for decades
to specify, visualize,
complex
text
or
XML-based
configuration
files
or
even
nontext
systems.
This
visual
UML
construct, and document systems. The Unified Modeling Language (UML) is one of those
presents
an UML
alternative
complementary
to the
source
text,
languages.
makesand
it possible
for team view
members
todifficult-to-understand
collaborate by providing
a common
especially
used as
and
checks.
MostEssentially,
such utilities
automatically
language when
that applies
tooverviews
a multitude
of sanity
different
systems.
it enables
you tolay out
the
resulting diagrams
allowing the
user to arrange
the diagrams. (Manual
communicate
solutionswithout
in a consistent,
tool-supported
language.
arrangement would impose undue work on the user.) The need for clarity and focus applies
equally
UML
produced
because
the reader
is still the
same.systems, which means
Today, to
UML
has
become by
thetools
standard
method
for modeling
software
you're probably confronting this rich and expressive language more than ever before. And
Though
UML provides
excellent
vehicle
for both
modeling
and
the resultant
even though
you mayan
not
write UML
diagrams
yourself,
you'll
stilldiagramming,
need to interpret
diagrams
necessarily
diagramsaren't
written
by others.the same. Modeling tolerates larger diagrams with a muddled
focus. A large diagram makes a better playground because the cost of refactoring many small
diagrams
outweighs
benefits
of the
clarity
diagrams
provide,
least in the early
UML 2.0 in
a Nutshellthe
from
O'Reilly
feels
your those
pain. It's
been crafted
foratprofessionals
like
stages
of design.
Once
you understand
the model
andartifacts
are comfortable
it, UML.
you can fission
you who
must read,
create,
and understand
system
expressedwith
using
the
resultant model
more
easily
into to
packages
and concise
Ease during this phase
Furthermore,
it's been
fully
revised
cover version
2.0 of diagrams.
the language.
validates the model's completeness; pain in diagramming indicates incompleteness in
modeling.
Details forgotten
against
vastness
of athe
model stand out
when
This comprehensive
new edition
notthe
only
provides
quick-reference
to all
UMLthe
2.0focus
diagram
narrows
to
a
very
small
context.
types, it also explains key concepts in a way that appeals to readers already familiar with

UML or object-oriented programming concepts.


Your documentation, UML and otherwise, must answer when you are absent. When you're
publishing
a guide to a toolkit, framework, or system, your audience will fail to exploit your
Topics include:
offering without clear and focused diagrams. At the same time, once the model is clearly
understood and concisely presented, discard the playground diagrams to avoid confusion.
The role and value of UML in projects
As with any other endeavor, shortcuts can be appropriate. If only you or an application
generator
a model, paradigm
you don't and
need
publishto
it the
for others.
If the model is implicitly
The access
object-oriented
itstorelation
UML
valid or you have better validation mechanisms, such as model checkers, you need not bother
An concise
integrated
approach
to UML
diagrams
creating
diagrams.
A code
generator,
for example, doesn't care about understandable
diagrams.
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
Deployment
Diagrams
No oneand
diagram
is definitive
in all aspects. To be effective, a diagram must have unity of
purpose. As a 2D view of the model, a diagram necessarily leaves out details in order to
Extension
Mechanisms
emphasize
important
features. The more economic the details, the more salient the features
appear in relief. Several diagrams, each with a different purpose, provide a clearer
The Object
Constraint
Language
(OCL)
understanding
than
one diagram
that has
all the details.
When diagramming, consider the purpose. The following sections detail several errors that
compromise the effectiveness of UML.
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

12.1.2. Structure and Interrelationships Among Classes


Figure 12-1 shows a class diagram cluttered by details. It gives no insight. Figure 12-2 shows

www.it-ebooks.info

the same classes without attributes and operations. More than half the diagram is an
understandable inheritance tree. Rid now of clutter, what's left becomes readable. The
converging lines draw the eye to Component at the center. You can clearly see the relationships
UML 2.0classes
in a Nutshell
between the abstract
and various interfaces. The subclasses clearly add individual
Byadding
Dan Pilone,
Neilstructure.
Pitman
behavior without
any
The diagram works. Once you understand the
...............................................
structure, you can
find the details of operations and attributes elsewhere, in such places as
O'Reilly
source commentPublisher:
extraction
tools such as Javadoc (supplied with the standard Java SDK from
Date:for
June
Sun)or CppDoc Pub
(check
it2005
athttp://www.cppdoc.com/).
ISBN:0-596-00795-7
Pages:234

Figure 12-2. The structure of commonly used components within the


Java AWT

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics12-2
include:
Figure
illustrates that good diagramming doesn't need to show everything. Effective
diagramming communicates one aspect of a system well. The less cluttered a diagram, the
better. We chose to communicate the class structure of the Java AWT system. To that end,
The role
and value
of UMLand
in projects
the diagram
focuses
on classes
their relationships, and leaves off details, such as
attributes, which have no bearing on the knowledge we are trying to share.
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams

12.1.3. Separate Inheritance and Class Interrelationships

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Our subset of the AWT doesn't contain enough complexity to require more simplification.
Figure 12-2 mixes the abstract class relationships and the concrete classes using them. For
Extension Mechanisms
even more clarity, together Figures 12-3 and 12-4 illustrate the same model as do Figures 121 and The
12-2,
but they
separate
the two (OCL)
concerns of abstraction and inheritance. Figure 12-3
Object
Constraint
Language
focuses on the abstraction common to all the Components. With just two interesting classes
and four supporting classes, Figure 12-3 is simple enough to memorize. That learned, the
inheritance hierarchy of concrete classes in Figure 12-4 becomes easy to classify and to
manipulate.
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

Figure 12-3. Structure of Components and Containers in the AWT

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
Figure 12-4. Inheritance tree of Component in the AWT
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
12.2. Sprawling
Scope
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
Figure 12-5 shows
an0-596-00795-7
example of a poorly focused sequence diagram. Sequence diagrams risk
Pages:
234
taking on too many
interactions
at once. This one shows the Struts interactions, the

application interactions, and then the detailed workings of the Java libraries.
Table of Contents | Index

Figure 12-5. Sequence diagram of HTTP form processing, spanning


System developers haveStruts,
used modeling
languages and
for decades
to specify, visualize,
application,
java.lang
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The at
Object
Constraint
(OCL)
Elements
the high
and lowLanguage
end of this
diagram are clearly out of scope of the application.
One rarely cares how Struts, as an off-the-shelf framework, works. It calls the application
logic at the appropriate time. Similarly, just how the internals of the standard libraries carry
out their obligations normally doesn't matter in terms of understanding the application. Both
If you're
newoftoHTTP
UML,request
a tutorial
with realistic
examples
hasof
even
been included to help you
the
structure
processing
and the
workings
Strings are God-given as far as
quickly
familiarize
yourself
with
the
system.
the application developer is concerned. However, by showing a few elements that are out of
scope, the diagram allows you to see the context of the application within the greater
framework, and that's often useful when selecting an architecture. Similarly, drilling down into
the base libraries exposes thread or performance issues. These are exceptional needs; there
is no call to complicate the description of an application with these exploratory needs. From
the readers' point of view, nonapplication elements just cloud understanding of the business

www.it-ebooks.info

logic, the only thing over which the developer exerts control.
Figure 12-6 shows the processing for another HTML form. It gets to the point. It is concise
2.0And
in a Nutshell
enough for one UML
page.
it focuses on interactions between the application classes; the
interactions are By
under
control
of the development team.
Dan Pilone,
Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
0-596-00795-7
Figure
12-6.
Sequence diagram with scope
Pages:234
programmer-defined classes

restricted to

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


Dan Pilone,Neil Pitman
12.3. OneBy
Diagram/One
Abstraction
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
0-596-00795-7
Earlier, in Figures
12-2
and 12-3, we separated structure from inheritance. Each diagram
Pages:234than the all-encompassing diagram shown in Figure 12-1, or even
contains fewer elements

the more modest one shown in Figure 12-2, so they are easier to understand. Figure 12-7
shows package dependencies. The diagram records both the import graph and code
Table of Contents
| Index
generation
directives.
The superimposition of these two roles results in a diagram with pairs
of opposing dependencies between elements. Don't worry if you don't quite understand its
meaning; we'll clean it up in a moment.
System developers have used modeling languages for decades to specify, visualize,
Figure
12-7and
failsdocument
as a diagram
for several
reasons.
Most strikingly,
don't
know
construct,
systems.
The Unified
Modeling
Languageyou
(UML)
is one
ofwhere
those to
start:
the diagram
has no
offor
gravity.
leads to
to collaborate
a lack of flow
direction;
do you
languages.
UML makes
it center
possible
team This
members
by or
providing
a common
read
the diagram
left totoright,
top to bottom,
or inside
out?Essentially,
The apparently
cyclic you to
language
that applies
a multitude
of different
systems.
it enables
dependencies
of direction.
Althoughlanguage.
opaque to the initiated, the problem
communicate confound
solutions any
in a sense
consistent,
tool-supported
withFigure 12-7 stems from trying to use one diagram for two related but different ends:
controlling
imports
and directing
code generation.
Today, UML
has become
the standard
method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.

Figure 12-7. Package diagram controlling imports and code


UML 2.0 in a Nutshell from O'Reilly
feels your pain.
It's been crafted for professionals like
generation
directives
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

Figure 12-8 addresses the issue of imports only. Elements higher in the diagram depend on
elements below. No cycles exist. You can absorb the meaning of the diagram quickly.

www.it-ebooks.info

Removing the imports from Figure 12-7 simplifies it more than you might imagine. Instead of
forming a graph like the imports, the directives, as shown in Figure 12-9, just link separate
elements with target packages. The noise of the import graph complicated a simple picture.
UML
2.0 indiagram
a Nutshellbecomes a small diagram of four separate sections.
The complicated,
large
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
12.4. Besides
UML
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
UML provides description
that's difficult to match with plain text. Its formalism allows a few
234
lines and boxes Pages:
to unequivocally
and immediately convey what would require time to

assimilate from text. The text replaced by diagrams would be, at best, dull and legalistic, and
at worst, vague, ambiguous, and open to interpretation. Either way, well-written UML is more
Table of Contents | Index
effective.
While it may be true that a picture is worth a thousand words, a picture with words is worth
much
more
than justhave
a picture.
Perhaps in
the context
MDA and
executable
models, UML
System
developers
used modeling
languages
for of
decades
to specify,
visualize,
can
provide
a
minimum
specification
for
an
application
generator.
In
most
cases,
complete
construct, and document systems. The Unified Modeling Language (UML) is one of
those
system
specification
or system
documentation
requirestocommentary
to explain,
languages.
UML makes
it possible
for team members
collaborate by
providingemphasize,
a common
and
give nuance
to theto
diagrams.
Diagrams
alonesystems.
risk burying
or glossing
over details
language
that applies
a multitude
of different
Essentially,
it enables
you toas
much
as text alone.
Diagrams
and text reinforce
each other.
You can describe the context and
communicate
solutions
in a consistent,
tool-supported
language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
Package
even though you may not Figure
write UML12-8.
diagrams
yourself, imports
you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

major points with text, then drive home those points with a good diagram and the formalism
of UML.

www.it-ebooks.info

As seen throughout this chapter, you can't effectively document classes with large APIs on a
single, class diagram. Hundreds of attributes and operations become insignificant on a
diagram. The operation and attribute sections of a class box don't allow for descriptions. Tools
UML
2.0 in a Nutshell
such as Doxygen
(http://www.doxygen.org)
or Javadoc extract the most current source
ByDan Pilone,Neil
Pitman
comments into searchable
web
pages. Though the details they present are likely to change
...............................................
and therefore will
make diagrams obsolete, when they are made part of the software build
Publisher:
process, they remain
upO'Reilly
to date with the latest software changes.
Pub Date: June 2005
0-596-00795-7
Remember that ISBN:
diagramming
requires neither model nor modeling tool. UML practitioners
Pages:
234
often simply draw
diagrams
by hand or with simple drawing tools. Modeling tools are
expensive acquisitions, in terms of time and distraction, if not in money: open source or
proprietary, UML tools take time to master. Whiteboards, notepads, and simple drawing tools
Table of Contents
Index
deliver
much |project
value with no learning curve. Use them until you are comfortable with
UML and its place in the project. With a firm understanding of UML and your process,
choosing a dedicated UML tool and changing your process to incorporate it becomes less
System developers have used modeling languages for decades to specify, visualize,
risky.
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions
in a consistent,
tool-supported
language.
Figure
12-9. Code
generation
directives

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

Appendix A. MDA: Model-Driven


Architecture
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

This appendix summarizes Model Driven Architecture (MDA). Several authors dedicate whole
books to MDA; seek out those books. The treatment here aims simply to demystify MDA
Table of Contents
| Index
enough
so that
you can talk sensibly about it. Better yet, investigate the vendor offerings.
Abstract descriptions don't deliver value: tools do.

System developers have used modeling languages for decades to specify, visualize,
construct, and Both
document
The Unifiedand
Modeling
(UML)Modeling
is one of those
Modelsystems.
Driven Architecture
MDA, Language
like the Unified
languages. UML
makes itand
possible
members
to collaborate
by providing
a common
Language
UML, for
areteam
trademarks
of the
Object Management
Group.
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


Dan Pilone,Neil Pitman
A.1. WhatBy
Is MDA?
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
0-596-00795-7
MDA is the natural
evolution
of UML, Object Oriented Analysis and Design (OOAD), code
generators, andPages:
third 234
millennium computing power. At the highest level, MDA envisions the

day that UML models become the standard way to design and build software. Business
software developers will build their systems through MDA tools. Development in 3GL
Table of Contents
| Index
languages
such
as Java or .Net will remain a toilsome necessity for the system level. For
business applications, current languages will be too inefficient to be viable, used only by the
most backward-looking organizations. As an analogy, consider the place of assembler and C
(or
even developers
C++) in main-line
business
applications
today.
System
have used
modeling
languages
for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
MDA
uses models
to get itthe
highestfor
leverage
out of software
development.
MDA isn't
a
languages.
UML makes
possible
team members
to collaborate
by providing
a common
development
a specification.
It isn't
an implementation.
isn't a you
conformance
language thatprocess.
applies It
toisn't
a multitude
of different
systems.
Essentially, it It
enables
to
suite.
It doesn'tsolutions
have a reference
implementation.
The OMG,
wisely, has avoided specifying
communicate
in a consistent,
tool-supported
language.
how you go about leveraging software models. MDA has not matured, so each of the nearly
50
companies
committed
to MDA
promote
vastly
visions.
If you
find this
confusing,
Today,
UML has
become the
standard
method
fordiffering
modeling
software
systems,
which
means
you
aren't
alone. confronting this rich and expressive language more than ever before. And
you're
probably
even though you may not write UML diagrams yourself, you'll still need to interpret
MDA
defines
a framework
for processing and relating models. MDA tools transform pure
diagrams
written
by others.
business models into complete, deployable, running applications with a minimum of
technological
decisions.from
Modifying
the
pure
business
model
behind
an for
application
require
UML 2.0 in a Nutshell
O'Reilly
feels
your
pain. It's
been
crafted
professionals
likeonly
updates
the dependent
technological
area(s).
Technology
unrelated
to the change
you whoinmust
read, create,
and understand
system
artifactsdecisions
expressed
using UML.
remain,
so the it's
application
can
be regenerated
in a matter
a few
minutes.
Furthermore,
been fully
revised
to cover version
2.0 ofofthe
language.
An application has many concerns; some related to the business itself, some related to a
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
particular implementation tier, some related to a particular implementation technology. MDA
types, it also explains key concepts in a way that appeals to readers already familiar with
further separates the technological concerns of an application from the business; it separates
UML or object-oriented programming concepts.
high-level technical decisions from their technological implementation; it separates one
technology from another. Web forms or database tactics don't complicate the business
Topics include:
concepts of, say, Account and Customer. Transaction management decisions don't affect
persistence. Messaging doesn't interfere with property management or security. Each
technology
canand
be replaced
without
recoding. In the extreme case, the business application
The role
value of UML
in projects
can be redeployed on a completely different technology platform.
The object-oriented paradigm and its relation to the UML
MDA keeps these separate concerns in different models, while at the same time keeping the
system
and
coherent
a whole.
The concept of account , for example, permeates
Anconsistent
integrated
approach
to as
UML
diagrams
most or all of the models: business, web, database, persistence, business logic, business
Class
and
Object,
Statechart,
Activity,
Component,
delegate,
and
code.
Not Use
onlyCase,
is anySequence,
one modelCollaboration,
consistent within
itself, but
also the
concepts
andmodel
Deployment
Diagrams
from one
relate to
the corresponding concepts in other models. Changes in the concept
ofaccount must affect all related models. This notion moves significantly ahead of current
Extension
Mechanisms
non-MDA
modeling
tools that either model everything in one model or require manual
synchronization of separate models.
The Object Constraint Language (OCL)
Although ultimately hoping to eliminate all programming languages, current MDA tools can't
provide enough finesse to deliver varied and high quality systems without a hybrid approach
of UML and 3GL. MDA allows handcoded extensions and other tweaking throughout the
If you're new to UML, a tutorial with realistic examples has even been included to help you
abstraction layers. It remembers the origins of these changes so that subsequent generations
quickly familiarize yourself with the system.
of the system respect them.
MDA tools are sophisticated systems. No offering has established itself as a leader. Most of
the MDA offerings cater to niche markets. Most predate MDA, so they drag along baggage of a
less well-defined approach, or of a well-defined but narrow proprietary approach. None
manages highly abstract models and generates crack code and generates a variety of

www.it-ebooks.info

implementations, at least not yet. Though a one-size-fits-all offering doesn't exist, many
offerings are very productive. The goal of MDA, while simple to voice, has yet to be fully
implemented.
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
A.2. The Models
of MDA
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
0-596-00795-7
Models play a big
role
in MDA. As a framework for building systems, MDA abstracts systems
234
into abstraction Pages:
layers.
Traditionally OOAD had analysis, detailed design and code roughly

representing a system's business perspective, the architectural/technological perspective, and


the implementation perspective. MDA adds one abstraction on top, representing the business
Table of Contents
context
of the| Index
system. Figure A-1 shows the different abstraction layers and their associated
MDA models. Abstraction increases toward the left and concreteness increases toward the
right. Concrete models outnumber abstract models. In general, the abstract begets the
concrete;
as each model
more concrete,
realizes
the to
abstractions
with respect to
System developers
havebecomes
used modeling
languagesit for
decades
specify, visualize,
one
technology
or platform.
The inverse,
makingModeling
abstractLanguage
models from
theisconcrete,
also
construct,
and document
systems.
The Unified
(UML)
one of those
known
as reverse
engineering,
rarely
except to
when
the starting
point is code.
Even
languages.
UML makes
it possible
forhappens,
team members
collaborate
by providing
a common
then
because
system
must
support
business,
startingEssentially,
from the business
needs
language
thatthe
applies
to a
multitude
of adifferent
systems.
it enables
you is
to
generally
moresolutions
appropriate.
communicate
in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
evenFigure
though you
may
notexample
write UML diagrams
you'll
stilltheir
need to
interpret
A-1.
An
of MDAyourself,
models
and
relationship
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The abstraction models match well with the conceptual layers of a system:
The role and value of UML in projects

The object-oriented paradigm and its relation to the UML


Computational-independent model (CIM)
An integrated approach to UML diagrams
The CIM represents the highest-level business model. The CIM uses a specialized
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
business process language and not UML, although its language could well be derived
and Deployment Diagrams
from the meta-object facility (MOF).

Extension Mechanisms
The CIM transcends computer systems. Each process interacts with human workers
and/or
machine
components.
The(OCL)
CIM describes these interactions between these
The Object
Constraint
Language
processes and the responsibilities of each worker, be it human or otherwise.
Anyone understanding business and business processes can understand a CIM. It avoids
specialized
knowledge
of procedures
internal
to a worker
computer
system,
If you're
new to UML,
a tutorial
with realistic
examples
has even
been included
to such
help as
you
accounting
procedures
or sales
commissions.
quickly
familiarize
yourself with
the system.
Platform-independent model (PIM)
A PIM represents the business model to be implemented by an information system.
Commonly, UML or some UML derivative describes the PIM.

www.it-ebooks.info

The PIM describes the processes and structure of the system, without reference to the
delivery platforms. The PIM ignores operating systems, programming languages,
in a Nutshell
hardware,UML
and2.0networking.
ByDan Pilone,Neil Pitman

Anyone understanding
the specialized domain of the computer system under study can
...............................................
understand
the
PIM.
Although
destined to be an information system, the PIM requires
Publisher:O'Reilly
no information
system
Pub Date:
June background.
2005
ISBN:0-596-00795-7

The PIM isPages:


the starting
point for MDA discussions in this appendix.
234
Platform-specific
model (PSM)
Table of Contents | Index
The PSM projects the PIM onto a specific platform. Because one PIM begets multiple
PSMs, the PSMs must collaborate to deliver a consistent and complete solution.
System
developers
used modeling
languages
forUML
decades
toto
specify,
Commonly,
thehave
implementer
defines
a different
profile
define visualize,
the PSM for each
construct,
and
document
systems.
The
Unified
Modeling
Language
(UML)
is one of those
target platform.
languages. UML makes it possible for team members to collaborate by providing a common
language
that applies
a multitude
of different
systems.
it enables
youexplicitly
to
The PSM
realizesto
the
PIM as it applies
to one
specific Essentially,
platform. The
PSM deals
communicate
solutions
in
a
consistent,
tool-supported
language.
with the operating system, programming language, technology platform (e.g., CORBA,
.Net, J2EE, or PHP), remote distribution or local collocation. Although porting from one
Today,
UML has
the
standard
method
for modeling
software
systems,
which
platform
or become
language
probably
means
discarding
the PSM,
sibling
PSMs and
the means
PIM
you'reremain
probably
confronting this rich and expressive language more than ever before. And
unchanged.
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams
written
by others.
Despite
the need
for an understanding of the underlying technology to understand the
PSM, the understanding need not be profound. Modelers must know the difference
UML 2.0
in a Nutshell
fromremotely
O'Reilly located
feels your
pain. It's been
for professionals
between
locally and
components;
theycrafted
don't need
to know how like
to
you who
must read,
create,
and understand system artifacts expressed using UML.
implement
or debug
them.
Furthermore, it's been fully revised to cover version 2.0 of the language.

This model
comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
Code
types, it also explains key concepts in a way that appeals to readers already familiar with
The
code model represents
the deployable
UML or
object-oriented
programming
concepts. code, usually in a high-level language such
as XML, Java, C#, C++, VB, HTML, JSP, or ASP. It may or may not be readable. It may
may not be extendable, although often it has extension points in the form of
Topicsorinclude:
protected code blocks.
The rolethe
andcode
value
of UML
in projects
Ideally,
model
is compile-ready.
It doesn't require any further human
intervention. Deployment should be automated. In a mature MDA environment, you can
The object-oriented
paradigm
its relation
the UML
think
of the code model
as youand
would
think of to
object
files or class filesthey're just
machine files, opaque to mere mortals.
An integrated approach to UML diagrams
In reality, MDA tools aren't mature. Developers need to understand the technology so
Classthey
and can
Object,
Use
Case,
Sequence,
Collaboration,
that
debug
the
application
or the
deployment.Statechart,
DevelopersActivity,
need toComponent,
load the
and Deployment
Diagrams
source
into IDEs and
debug and deploy as normal. Because little code is actually
handwritten, the dilemma is more to deploy correctly than to debug infrastructure.
Extension Mechanisms
These models can continue on to the right. We can have a bytecode or link object model, and
The
Object
Constraint
(OCL) has matured so much that the vast majority of
beyond
that
a machine
code Language
model. Software
workers take those models for granted. They just work. If they don't, we just replace them.
Figure A-1 shows a one-tier PSM. MDA doesn't restrict PSMs to one tier. Each PSM addresses
If you're new to UML, a tutorial with realistic examples has even been included to help you
a different technological layer of a system. If a particular technology lends itself to multiple
quickly familiarize yourself with the system.
layers of abstraction, the PSM allows for that too. The specific technologies, and hence, PSMs,
are defined by the MDA tool and the architecture it proposes. As a business application
developer, you will have to work with that particular framework.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
A.3. Design
Decisions
...............................................
Publisher:O'Reilly
PubFigure
Date: June
As you've seen in
A-1, 2005
the number of models increases as you go from the abstract to
ISBN:
0-596-00795-7
the concrete. How
abstract
models become transformed into more concrete models will be
234
discussed a littlePages:
later.
For now, suffice it to say that some function transforms them. Several
concrete models can come from a single abstract model. At any one level of abstraction, the
model presents the system, without the messiness of implementation details found in the
Table of concrete,
Contents | Index
more
downstream models.

Effective model transformation demands precise implementation details. Decisions at one


layer
imply
gross differences
atmodeling
the next, languages
more concrete
layer. Consider
thevisualize,
following business
System
developers
have used
for decades
to specify,
rules:
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
There aresolutions
only a few
states, and
they don't change.
communicate
in (50)
a consistent,
tool-supported
language.
Account transactions can be added, but never changed or deleted, and there can be
Today, UML has become the standard method for modeling software systems, which means
hundreds of thousands of transactions for one account.
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
Account balances are updated very often, but account contact information is updated
diagrams written by others.
relatively rarely compared to the number of times it's read. Changes must be audited.

2.0 in
a Nutshell
O'Reilly feels
your pain.
It's
been
craftedyou
for would
professionals
like
IfUML
similar
code
were to from
be generated
to manage
these
data
entities,
have a very
you who
must
create,
understand
system
artifacts
expressed
using
UML. model to
poor
system.
Toread,
live up
to itsand
moniker,
MDA must
provide
some
clue in the
business
Furthermore,
it's been
fully cases.
revisedThe
to cover
version
of the
language.
differentiate
between
these
business
layer2.0
doesn't
involve
itself with design issues
such as data access patterns, but it must provide hints. These hints are design decisions .
This comprehensive
new
edition
not only
provides (a
a quick-reference
to all UML
2.0 diagram
Models
provide implicit
hints
through
the structure
one-to-one association
versus
a manytypes,
it
also
explains
key
concepts
in
a
way
that
appeals
to
readers
already
familiar
with the
to-one association), and they can be elaborated with explicit hints (such as differentiating
UML or
object-oriented
programming concepts.
three
earlier
cases).
Topics
include:
At
the level
of code generation, 3GLs have hints, although they work at a much lower level of
abstraction. Programmers switch on code optimization or debugging information. As a result,
the bytecode/object code becomes vastly different, with different performance characteristics.
The role and value of UML in projects
Figure A-2 shows how MDA records design decisions as marks . A transformation function uses
The object-oriented paradigm and its relation to the UML
related marks, held in a subordinate marking model , along with the principle model, either
PIM or PSM as the case may be, to create the next, more concrete model. Partitioning the
An integrated approach to UML diagrams
marks into separate marking models keeps the principle model pure, and the marks related to
different
concerns
separate
other. Were
the downstream
technology
change, the
Class
and Object,
Usefrom
Case,each
Sequence,
Collaboration,
Statechart,
Activity,toComponent,
relatedand
marks
could be Diagrams
dropped without disturbing the principle model.
Deployment

Extension Mechanisms
The Object
Constraint
Language
(OCL)
Figure
A-2.
Tightly
coupled
marking models keep technology
decisions out of the principal models
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System
developers
used modeling
languages
decadesmodel.
to specify,
visualize,
Model
elaboration
is have
the intentional
enrichment
of a for
generated
Generated
models
construct,
and
document
systems.
The
Unified
Modeling
Language
(UML)
is
one of
thoseor
likely have need tailoring or optimization (otherwise, why have them?). Modelers
assign
languages.
UML makes
it possible
for team members
to collaborate
by will
providing
a common
update
the marks
to control
the transformation
function.
Programmers
add custom
code
language
that
applies
to arecord
multitude
different
Essentially,
it enables
youfrom
to
in
protected
areas.
Marks
bothof
the
updatessystems.
and whether
the marks
originate
communicate solutions in a consistent, tool-supported language.
humans.
Today,
UML has
become
standard
method
forthe
modeling
software
means
The
unpolluted
model,
be the
it PIM
or PSM,
remains
same no
matter systems,
how manywhich
downstream
you're probably
confronting
this rich model
and expressive
language more
than ever
before. And
technologies
there
are. The principle
remains unchanged,
regardless
of whether
a
even though
you appears
may not or
write
UML diagrams yourself, you'll still need to interpret
dependent
model
disappears.
diagrams written by others.
With the technology concerns partitioned from the principle model and each other, the
UML 2.0 models
in a Nutshell
from independently
O'Reilly feels your
pain.
It's been
crafted for professionals
marking
can evolve
of each
other.
The technology
functions can like
create
you who
mustfor
read,
create,Technical
and understand
system
expressed
usingfields,
UML. elaborate
default
marks
elements.
modelers,
who artifacts
are experts
in different
Furthermore,
it's been fully revised to cover version 2.0 of the language.
their
models separately.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
A.4. Sewing
the Models Together
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
At any one time,
the 0-596-00795-7
many models are implicitly related. For example, a transformation
Pages:
234
function transforms
the
PIM and related marks from a marking model to create a PSM. An

MDA system of models probably has several PSMs, each with its own marking model and at
least one code model, and likely its own marking model or handcoded extensions.
Table of Contents | Index

Over time, the PIM will change, as will the marks on it and on the PSM. If the transformation
function summarily overwrites existing marks explicitly updated by a modeler, the effect of
the
marks
disappears;
theused
modeler
must languages
reenter all for
again.
Clearly,
this is untenable.
System
developers
have
modeling
decades
to specify,
visualize, On the
other
hand,
deletions
from
the
PIM
will
remove
the
justification
of
derived
elements
in the
construct, and document systems. The Unified Modeling Language (UML) is one of those
PSM.
The transformation
havemembers
a way to to
detect
and merge
collisions,a and
to
languages.
UML makes itfunction
possiblemust
for team
collaborate
by providing
common
remove
deadwood.
Traceability
of ownership
and systems.
generation
becomes ait serious
language
that applies
to a multitude
of different
Essentially,
enablesissue.
you to
communicate solutions in a consistent, tool-supported language.
MDA stores the relationships between source models, marks, and target models in a mapping
model
. The
in Figure
A-3 shows
how each
element in
the target
modelwhich
has a means
Today,
UMLexample
has become
the standard
method
for modeling
software
systems,
mapping
to the source
modelthis
andrich
the and
appropriate
marks
(and, more
optionally,
to the
marking
you're probably
confronting
expressive
language
than ever
before.
And
models).
even though you may not write UML diagrams yourself, you'll still need to interpret

diagrams written by others.


UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like

Figure
A-3.read,
Mapping
ensure
traceability
between
you who must
create, models
and understand
system
artifacts expressed
using the
UML. models
and
the
marks
Furthermore, it's been fully revised to
cover
version
2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)
The mappings provide the traceability necessary for subtle evolution of the whole system. The
transformation process follows the links when updating a target model from new versions of
If you're new to UML, a tutorial with realistic examples has even been included to help you
the source model or source mark model. The transformation function detects conflicts
quickly familiarize yourself with the system.
between the generated elements and the existing element added or modified by modelers. It
identifies deadwood in the new target model that exists only because of now-deleted
elements in the source model.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
A.5. Transforming
Models
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:
0-596-00795-7
The models up to
now
provide multiple abstractions of the system. They separate the
Pages:
234trace the origin of each element. These models are static.
platform concerns.
They

Transformation functions apply a transformation to a source model to produce a target model.


Figure A-4 shows the general case of the transformation function creating or updating target
Table of Contents
Index
models
from |the
source model and marks. The transformation function, along with the marks
and the mappings, are called the bridge between the two principle models.
The
mapping
model have
acts in
twomodeling
roles. Before
the transformation,
relates the
elements of the
System
developers
used
languages
for decades toit specify,
visualize,
source
models,
together
with
previous
versions
of
the
target
models.
After
the
construct, and document systems. The Unified Modeling Language (UML) is one of those
transformation,
mapping
modelfor
traces
source of
targetby
model
element
created
languages. UMLthe
makes
it possible
teamthe
members
to every
collaborate
providing
a common
or
updated.
language
that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
During model evolution, transformations at the PIM can cause turmoil in the PSM and code
models.
Because
of the leverage
MDA gives,
slight
refactoring
can render
the mapping
model
Today, UML
has become
the standard
method
for modeling
software
systems,
which means
incapable
of reconciling
changes.
If mappings
are recorded
by element
ID,ever
deleting
an And
you're probably
confronting
this rich
and expressive
language
more than
before.
element
and recreating
it risks
it from
its marks
even though
you may not
writeorphaning
UML diagrams
yourself,
you'll still need to interpret

diagrams written by others.


UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
model
transformations
automate
you Figure
who mustA-4.
read,Custom
create, and
understand
system artifacts expressed
usingchanging
UML.
levels
Furthermore, it's been fully revisedabstraction
to cover version
2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
and derivative
elements
in the
target models.
The Object
Constraint
Language
(OCL) If the PSM or code model has a great deal of
elaboration, MDA doesn't proscribe a solution to this.
Figure A-4 shows a transformer acting through a transformation definition. The transformer
If you're
new to UML,
a tutorial
has even
been In
included
to help
can
be implemented
equally
wellwith
as a realistic
script orexamples
a procedural
language.
any case,
eachyou
quickly familiarize
yourself
withdefinition;
the system.
transformation
requires
its own
the transformer from PIM to presentation PSM
can't be reused for the database PSM to SQL code model.
The concept of reverse engineering, or round-trip engineering, received a great deal of
interest a few years ago. MDA doesn't address it specifically. Each transformation function can
have an inverse function to create the abstract from the concrete, but nothing requires an

www.it-ebooks.info

MDA solution to provide it.


Reverse engineering generally creates more problems than it solves. You reverse-engineer
UML 2.0 in models.
a Nutshell Concrete models may not respect the naming conventions, or
only elaborate concrete
they may have slight
or gross
variants of expected patterns. The resultant abstract model will
ByDan Pilone,
Neil Pitman
have no insight ...............................................
into the structures found. Furthermore, it becomes unclear where ultimate
truth lies. Remember,
MDA
doesn't stand for program-driven modeling.
Publisher:
O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
A.6. Languages
to Formally Describe MDA
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
The transformations
describe in the preceding section can't work without strict inputs. Each
Pages:
model must respect
a234
structure that constrains its expressiveness formally; automated

transformations can't understand just any model. Each model requires a specialized model, as
shown in Figure A-5. UML profiles provide one vehicle to constrain each model; alternative
Table of Contentsmetamodels
| Index
MOF-based
provide another.
Explicit UML profiles enforce constraints so that only models considered valid by the
transformers
can be have
processed.
Considering
the leverage
of expression
between
the PIM and
System developers
used modeling
languages
for decades
to specify,
visualize,
each
PSM,
and
again
between
each
PSM
and
its
derivative
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.

Figure A-5. Each model and transformation definition conforms to a


Today, UML has become the standard method
for modeling software systems, which means
language
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

code models, slightly invalid source models would produce rubbish. UML profiles provide the
discipline needed to keep such a complex system running.

www.it-ebooks.info

MDA systems need not have such a formal definition as the one we described. Certainly
architects who extend the transformations with custom scripting will not back it with a formal
transformation language. The languages act much as DTDs or schemas do for an XML
UML 2.0 assure
in a Nutshell
document: languages
that the consumers will understand the model.
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

Appendix B. The Object Constraint


Language
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

The Object Constraint Language 2.0 (OCL) is an addition to the UML 2.0 specification that
provides you with a way to express constraints and logic on your models. For example, you
Table use
of Contents
| Index
can
OCL to
convey that a person's age must always be greater than 0 or that a branch
office must always have one secretary for every 10 employees.
OCL
isn'tdevelopers
new to UMLhave
2.0;used
it was
first introduced
in UML
1.4. However,
as ofvisualize,
UML 2.0, it was
System
modeling
languages
for decades
to specify,
formalized
using
the
Meta-Object
Facility
and
UML
2.0.
From
a
user's
perspective
the
construct, and document systems. The Unified Modeling Language (UML) is one of
those
language
hasUML
been
updated
and refined
but the
fundamentals
remainby
the
same. This
appendix
languages.
makes
it possible
for team
members
to collaborate
providing
a common
introduces
the basic
concepts
of OCL. of
For
more detailed
information,
the OCL
language that
applies
to a multitude
different
systems.
Essentially,consult
it enables
you to
specification
available
from
Object Management
Group's
web site (http://www.omg.org/).
communicate
solutions
in athe
consistent,
tool-supported
language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


Dan Pilone,Neil Pitman
B.1. OCL By
Basics
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
The Object Constraint
Language is just that: a language. It obeys a syntax and has keywords.
However, unlikePages:
other234
languages, it can't be used to express program logic or flow control. By

design, OCL is a query-only language; it can't modify the model (or executing system) in any
way. It can be used to express preconditions, postconditions, invariants (things that must
Table of Contents
| Index
always
be TRue
), guard conditions, and results of method calls.
OCL can be used virtually anywhere in UML and is typically associated with a classifier using a
note.
When
an OCL expression
is evaluated,
it is considered
to be
meaning the
System
developers
have used modeling
languages
for decades
to instantaneous,
specify, visualize,
associated
classifier
can't
change
state
during
the
evaluation
of
an
expression.
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate
solutions
B.1.1.
Basic
Typesin a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
OCL has several built-in types that can be used in OCL expressions:
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
Boolean
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who
read, true
create,
and understand
artifacts
expressed
UML.
Mustmust
be either
or false
. Supports system
the logical
operators
and,or,using
xor,not
,implies,
Furthermore,
it's
been
fully
revised
to
cover
version
2.0
of
the
language.
andif-then-else.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
Integer
UML or object-oriented programming concepts.
Any integer value (e.g., 100, -12345, 5211976, etc.). Supports the operators *,+,-,/,
abs( ).
Topicsand
include:
Real

The role and value of UML in projects


The object-oriented
paradigm
and its
relation
to the
UML the operators *,+,-,/, and
Any
decimal value (e.g.,
2.222003,
-67.76,
etc.).
Supports
floor( ).
An integrated approach to UML diagrams

String Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
A series of letters, numbers, or symbols interpreted as a string (e.g., "All writing and no
Extension
play
make Mechanisms
Dan..."). Supports the operators concat( ),size( ), and substring( ).

The Object
Language
(OCL) used in your UML model is recognized as a type
In addition
to the Constraint
built-in types,
any classifier
by OCL. Because OCL is a strongly typed language, you can't compare values of one type
directly with values of another type.
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

B.1.2. Casting

OCL does support casting objects from one type to another as long as they are related
through a generalization relationship. To cast from one type to another use the operation

www.it-ebooks.info

oldType. oclAsType(newType) . For example, to cast a Java List to an ArrayList to call the
size( ) operation, use the expression:
UML 2.0 in a Nutshell

List.oclAsType(ArrayList).size(
ByDan Pilone,Neil Pitman

...............................................
Publisher:O'Reilly
If the actual object
isn't an
instance
Pub Date:
June
2005 of the new type, the expression is considered undefined.
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


Dan Pilone,Neil Pitman
B.2. OCL By
Syntax
...............................................
Publisher:O'Reilly
Pub
Date:
June 2005
The remainder of
this
chapter
uses examples from the class diagram shown in Figure B-1.
ISBN:0-596-00795-7
Pages:234

B.2.1. Constraints on Classifiers


Table of Contents | Index

Each OCL expression must have some sense of context that an expression relates to. Often
the
context
can be determined
by where languages
the expression
is written.
For example,
you can link
System
developers
have used modeling
for decades
to specify,
visualize,
aconstruct,
constraintand
to an
element
using
a
note.
You
can
refer
to
an
instance
of
the
context
classifier
document systems. The Unified Modeling Language (UML) is one of those
using
the keyword
self. itFor
example,
you members
had a constraint
on Student
that theira GPA
must
languages.
UML makes
possible
for if
team
to collaborate
by providing
common
always
be
higher
than
2.0,
you
can
attach
an
OCL
expression
to
Student
using
a
note
and
language that applies to a multitude of different systems. Essentially, it enables you to
refer
to the GPA
as follows:
communicate
solutions
in a consistent, tool-supported language.

Today,
UML has
the standard method for modeling software systems, which means
self.GPA
> become
2.0
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.

Figure B-1. Example class diagram used in this chapter

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)
It's important to realize that this OCL expression is an invariant, meaning the system would
be in an invalid state if a student's GPA dropped to less than 2.0. If you want to allow a GPA
of less than 2.0 and send out a letter to the student's parents in the event such a low GPA is
If you're new
to UML,
a tutorial
realistic
examples
has evensuch
been
to help
achieved,
you would
model
such with
behavior
using
a UML diagram
asincluded
an activity
or you
quickly familiarize
interaction
diagram.yourself with the system.
You can follow associations between classifiers using the association end names as though
they were attributes of the originating classifier. The following invariant on Course ensures
that the instructor is being paid:

www.it-ebooks.info

self.instructor.salary > 0.00

a Nutshell of 0..1, you can treat the association end as a Set and
If an associationUML
has2.0a inmultiplicity
ByDan
Pilone,
check to see if the
value
isNeil
setPitman
by using the built-in notEmpty( ) operation. To call the
...............................................
notEmpty( ) operation
on a set you must use an arrow (->) rather than a dot (.). See
O'Reilly
"Collections" forPublisher:
more information
on sets. The following invariant on Course enforces that a
Pub Date: June 2005
course has an instructor:
ISBN:0-596-00795-7
Pages:234

self.instructor->notEmpty(

Table of Contents | Index

If an association role name isn't specified, you can use the classifier name. The following
invariant on School checks that each course has a room assignment:

System developers have used modeling languages for decades to specify, visualize,
construct,
and document systems. The Unified<>
Modeling
Language (UML) is one of those
self.Course->forAll(roomAssignment
'No room!')
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate
in ainto
consistent,
tool-supported
language.
Comments
cansolutions
be inserted
an expression
by prefixing
each comment with two dashes (),
like this:
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
make you
suremay
this
could
graduate
even--though
notstudent
write UML
diagrams
yourself, you'll still need to interpret
self.GPA
> 2.0
diagrams
written
by others.

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
Ifyou
youwho
can't
determine
the context
of an expression
lookingexpressed
at the UMLusing
model,
or if you
must
read, create,
and understand
systemby
artifacts
UML.
want
to be explicit
with fully
the context,
usecover
the OCL
keyword
, followed by the classifier
Furthermore,
it's been
revised to
version
2.0 ofcontext
the language.
name. If you use this notation, you should say what the expression represents. In the
following
case, we're new
showing
an invariant,
so we use
the keyword invto
. Other
types
of
This comprehensive
edition
not only provides
a quick-reference
all UML
2.0 diagram
expressions
are
explained
later sections.
types, it also
explains
keyinconcepts
in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
context Student
Topics
include:
inv:
self.GPA > 2.0

The role and value of UML in projects


Instead of using the keyword self, you can assign a name to a classifier that you can use in
the expression.
Write the name
you and
wantits
torelation
use, followed
a colon (:) and then the
The object-oriented
paradigm
to the by
UML
classifier name. For example, you can name the instance of Student as s:
An integrated approach to UML diagrams
context s : Student
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
inv: s.GPA > 2.0
and Deployment Diagrams

Extension Mechanisms
Finally, you can name an expression by placing a label after the expression type but before
the colon
:). TheConstraint
label is purely
decorative;
The (Object
Language
(OCL) it serves no OCL function.
context s : Student
inv minimumGPARule: s.GPA > 2.0
If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

B.2.2. Constraints on Operations


Beyond basic classifiers, OCL expressions can be associated with operations to capture

www.it-ebooks.info

preconditions and postconditions. Place the signature of the target operation (classifier,
operation name, parameters, etc.) after the context keyword. Instead of the invariant
keyword, use either pre or post for preconditions and postconditions, respectively.
UML 2.0 in a Nutshell

The following expression


ensures
that any student who will be registered for a course has paid
ByDan Pilone,
Neil Pitman
their tuition:
...............................................
Publisher:O'Reilly
Pub Date: June 2005
context Course::registerStudent(s : Student) : boolean
ISBN:0-596-00795-7
pre: s.tuitionPaid = true
Pages:234

When
writing| postconditions,
you can use the keyword result to refer to the value returned
Table of Contents
Index
by an operation. The following expressions verify that a student's tuition was paid before
registering for a course and that the operation registerStudent returned true:

System developers have used modeling languages for decades to specify, visualize,
construct,
andCourse::registerStudent(s
document systems. The Unified
Modeling Language
(UML) is one of those
context
: Student)
: boolean
languages.
UML makes it possible
pre: s.tuitionPaid
= true for team members to collaborate by providing a common
language
applies
to a multitude of different systems. Essentially, it enables you to
post:that
result
= true
communicate solutions in a consistent, tool-supported language.
Today,
UMLwith
hasinvariants,
become the
standard
method
for modeling
systems,
which means
As
you can
you
can name
preconditions
and software
postconditions
by placing
a label
you're
confronting
this rich and expressive language more than ever before. And
after
theprobably
pre or post
keywords:
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
context Course::registerStudent(s : Student) : boolean
pre hasPaidTuition: s.tuitionPaid = true
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
post studentWasRegistered: result = true
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
Postconditions
can use
theedition
@pre keyword
refer toathe
value of sometoelement
an
This comprehensive
new
not onlyto
provides
quick-reference
all UMLbefore
2.0 diagram
operation
executes.
The
following
expression
ensures
that
a
student
was
registered
and
that
types, it also explains key concepts in a way that appeals to readers already familiar with
the
number
of students in
the course has
increased by 1. This expression uses the self
UML
or object-oriented
programming
concepts.
keyword to reference the object that owns the registerStudent operation.

Topics include:
context Course::registerStudent(s : Student) : boolean
pre: s.tuitionPaid = true
The role
and value
of UML
projects
post:
result
= true
AND in
self.students
= self.students@pre + 1
The object-oriented paradigm and its relation to the UML
You may
the approach
results of to
a query
operation using the keyword body. Because OCL
An specify
integrated
UML diagrams
doesn't have syntax for program flow, you are limited to relatively simple expressions. The
following
expression
indicates
that Sequence,
honors students
are students
with GPAs
higherComponent,
than 3.5.
Class
and Object,
Use Case,
Collaboration,
Statechart,
Activity,
The collection
syntax used
in this example is described in the "Collections" section.
and Deployment
Diagrams

Extension Mechanisms
context Course::getHonorsStudents( ) : Student
body: self.students->select(GPA > 3.5)
The Object Constraint Language (OCL)

B.2.3.
on Attributes
If you'reConstraints
new to UML, a tutorial
with realistic examples has even been included to help you
quickly familiarize yourself with the system.
OCL expressions can specify the initial and subsequent values for attributes of classifiers.
When using OCL expressions with attributes, you state the context of an expression using the
classifier name, two colons (::), the attribute name, another colon (:), and then the type of
the attribute. You specify the initial value of an attribute using the keyword init:

www.it-ebooks.info

context School::tuition : float


init: 2500.00
UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman

You can specify ...............................................


the value of attributes after their initial value using the derive keyword. The
following example
increases
the tuition value by 10% every time you query it:
Publisher:
O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7: float
context: School::tuition
Pages:234

derive: tution * 10%


Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
B.3. Advanced
OCL Modeling
...............................................
Publisher:O'Reilly
Pub Date: June
Like any other language,
OCL2005
has an order of precedence for operators, variable declarations, and
ISBN:
0-596-00795-7
logical constructs
(only
for evaluating your expressions, not for program flow). The following
Pages:
234
sections describe
constructs
that you can use in any OCL expression.

Table of Contents | Index

B.3.1. Conditionals
OCL
supports
basic boolean
expression
the if-then-else-endif
keywords. The
System
developers
have used
modelingevaluation
languagesusing
for decades
to specify, visualize,
conditions
are
used
only
to
determine
which
expression
is
evaluated;
they
can't
be
construct, and document systems. The Unified Modeling Language (UML) is one of used
thoseto
influence
theUML
underlying
system
or for
to affect
The following
invariant aenforces
languages.
makes it
possible
team program
membersflow.
to collaborate
by providing
commonthat a
student's
graduation
is valid only
if she has
paid herEssentially,
tuition:
languageyear
that of
applies
to a multitude
of different
systems.
it enables you to

communicate solutions in a consistent, tool-supported language.


context Student inv:
Today,
has become
the standard
method for modeling software systems, which means
if UML
tuitionPaid
= true
then
you're yearOfGraduation
probably confronting= this
rich and expressive language more than ever before. And
2005
evenelse
though you may not write UML diagrams yourself, you'll still need to interpret
diagrams
written by others.
yearOfGraduation
= 0000
endif
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore,
it'sare
been
fully revised
cover
version
2.0 of the language.
OCL's
logic rules
slightly
differenttofrom
typical
programming
language logic rules. The boolean
evaluation rules are:
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
1. TrueOR-ed with anything is true.
Topics include:
2. FalseAND-ed with anything is false.
3. False
IMPLIES
TRue
The role
andanything
value of is
UML
in. projects
Theimplies
keyword evaluate
the first
half
an expression,
and, if that first half is true, the result
The object-oriented
paradigm
and
itsof
relation
to the UML
is taken from the second half. For example, the following expression enforces that if a student's
integrated
diagrams
GPA isAn
less
than 1.0,approach
their yeartoofUML
graduation
is set to 0. If the GPA is higher than 1.0, Rule #3
applies, and the entire expression is evaluated as true (meaning the invariant is valid).
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
context Student inv:
self.GPA
1.0 IMPLIES self.yearOfGraduation = 0000
Extension<Mechanisms

The Object Constraint Language (OCL)


OCL's boolean expressions are valid regardless of the order of the arguments . Specifically, if the
first argument of an AND operator is undefined, but the second operator is false, the entire
expression is false. Likewise, even if one of the arguments to an OR operator is undefined, if the
If you're
new
to UML,
a tutorial
with.If-then-else-endif
realistic examples has
even been
to similarly;
help you if the
other
is true
, the
expression
is true
constructs
areincluded
evaluated
quickly
familiarize
yourself
with
the
system.
chosen branch can be evaluated to TRue or false, the nonchosen branch is completely disregarded
(even if it would be undefined).

B.3.2. Variable Declaration

www.it-ebooks.info

OCL supports several complex constructs you can use to make your constraints more expressive
and easier to write. You can break complex expressions into reusable pieces (within the same
UML 2.0 in a Nutshell
expression) by using the let and in keywords to declare a variable. You declare a variable by
Byfollowed
Dan Pilone,Neil
Pitman
giving it a name,
by a
colon (:), its type, an expression for its value, and the in keyword.
...............................................
The following example declares an expression that ensures a teacher of a high-level course has an
Publisher:O'Reilly
appropriate salary:
Pub Date: June 2005
ISBN:0-596-00795-7
context Course
inv:
Pages:234

let salary : float = self.instructor.salary in


if self.courseLevel > 4000 then
salary
> 80000.00
Table of Contents
| Index
else
salary < 80000.00
endif
System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
You
can define
variables
can be used
in multiple
expressions
on a it
classifier-by-classifier
basis
language
that applies
to that
a multitude
of different
systems.
Essentially,
enables you to
using
the def keyword.
instead
of declaring
salary as a variable using the let
communicate
solutions For
in aexample,
consistent,
tool-supported
language.
keyword, you can define it using the def keyword for the Course context. Once you define a
variable
usinghas
thebecome
def keyword,
you may
use that
any expression
that
is inmeans
the same
Today, UML
the standard
method
for variable
modelinginsoftware
systems,
which
context.
The syntax
for the def
the same as
that formore
the let
keyword:
you're probably
confronting
thiskeyword
rich andisexpressive
language
than
ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams
written
by others.
context
Course
def: salary : float = self.instructor.salary
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
So, now you can write the previous invariant as:

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
context
Course inv:
types,
it also explains
key concepts in a way that appeals to readers already familiar with
> 4000 then
UMLif
or self.courseLevel
object-oriented programming
concepts.
salary > 80000.00
getHonorsStudentselse
Topics
include:
salary < 80000.00
endif
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML

B.3.3. Operator Precedence

An integrated approach to UML diagrams

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
OCL operators have the following order of precedence (from highest to lowest):
and Deployment Diagrams
Extension Mechanisms
@pre
The(.Object
Constraint
Language (OCL)
dot
) and arrow
(->) operations
not and unary minus (-)

If you're
* andnew
/ to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.
+ and if-then-else-endif
<,>,<=, and >=

www.it-ebooks.info

= and <>
and,or, and xor
UML 2.0 in a Nutshell

implies

ByDan Pilone,Neil Pitman


...............................................

You can use parentheses


to group expressions, which will be evaluated from the innermost set of
Publisher:O'Reilly
parentheses to the
outermost.
Pub Date:
June 2005
ISBN:0-596-00795-7
Pages:234

B.3.4. Built-in Object Properties


Table of Contents | Index

OCL provides a set of properties on all objects in a system. You can invoke these properties in your
expressions as you do any other properties. The built-in properties are:

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML
possible for team members to collaborate by providing a common
oclIsTypeOf
(t :makes
Type ):itBoolean
language that applies to a multitude of different systems. Essentially, it enables you to
communicate
solutions
a consistent,
language.
Returnstrue
if the in
tested
object is tool-supported
exactly the same
type as t.
Today, UML has become the standard method for modeling software systems, which means
oclIsKindOf(
t : confronting
Type ): Boolean
you're probably
this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
Returns
TRue by
if the
tested object is the same type or a subtype of t.
diagrams
written
others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
oclInState(s
Statecreate,
): Boolean
you who must :read,
and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
ReturnsTRue if the tested object is in state s. The states you can test must be part of a state
machine attached
the classifier
being
tested.
This comprehensive
newtoedition
not only
provides
a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
oclIsNew( ) : Boolean
TopicsDesigned
include: to be used in a postcondition for an operation, it returns true if the object being
tested was created as a result of executing the operation.
The role and value of UML in projects
oclAsType (t : Type ): Type
The object-oriented paradigm and its relation to the UML
Returns the owning object casted to Type . If the object isn't a descendant of t, the operation
An integrated approach to UML diagrams
is undefined.

Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
Here are
examples
of the built-in properties:
andsome
Deployment
Diagrams
Extension
Mechanisms
-test that
the instructor is an instance of Teacher
context Course
The Object
Constraint Language (OCL)
inv:
self.instructor.oclIsTypeOf(Teacher)
-- cast a Date class to a java.sql.Date to verify the minutes
-- (it's very unlikely the foundationDate would be a java.sql.Date
If you're
newthis
to UML,
a tutorialwould
with realistic
examplesbut
hasthis
even is
been
-- so
invariant
be undefined,
anincluded
exampleto help you
quickly
familiarize
yourself
with
the
system.
-- of using oclAsType( ))
context School
inv: self.foundationDate.oclAsType(java.sql.Date).getMinutes( ) = 0

www.it-ebooks.info

B.3.5. Collections
UML 2.0 in a Nutshell

OCL defines several types of collections that represent several instances of a classifier. The basic
ByDan Pilone,Neil Pitman
type is Collection, which is the base class for the other OCL collection classes. Quite a few
...............................................
operations are defined for Collection; see the OCL specification for the complete list.

Publisher:O'Reilly
Pub Date: June 2005
All collections support a way to select or reject elements using the operations select( ) and
ISBN:0-596-00795-7
reject( ), respectively.
To invoke an operation on a collection, you use an arrow (->) rather than a
Pages:234

dot (.) (a dot accesses a property). The result of select or reject is another collection containing
the appropriate elements. Remember that since OCL can't modify a system in any way, the original
collection
is unchanged. The notation for a select is:
Table of Contents | Index
collection->select(boolean expression)
System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages.
makes
it possible
for team
to collaborate
by providing a common
So,
to selectUML
students
with
GPAs higher
thanmembers
3.0, you can
use the expression:
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
context Course::getHonorsStudents( ) : Student
body: self.students->select(GPA > 3.0)
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
Or,
to eliminate
honor
students that haven't paid their tuition:
diagrams
written
by others.

UML context
2.0 in a Nutshell
from O'Reilly feels your pain.
been crafted for professionals like
Course::getHonorsStudents(
) : It's
Student
you body:
who must
read, create, and understand
system artifacts expressed using
UML.
self.students->select(GPA
> 3.0)->reject(tuitionPaid
= false)
Furthermore, it's been fully revised to cover version 2.0 of the language.
This
new edition
not only
provides
a and
quick-reference
to all UML
diagram
In
thecomprehensive
previous examples,
the context
for the
select
reject statements
was2.0
implied.
You can
types, it name
also explains
key concepts
wayin
that
readers already
familiar
with
explicitly
the element
you wantintoa use
theappeals
booleantoexpression
by prefixing
the
expression
UMLaorlabel
object-oriented
programming
with
and a pipe symbol
(|). So,concepts.
a rewrite of the GPA example using a label to identify each
student looks like this:
Topics include:
context Course::getHonorsStudents( ) : Student
body:
self.students->select(curStudent
| curStudent.GPA > 3.0)
The role
and value of UML in projects

The object-oriented paradigm and its relation to the UML


Finally, you can specify the type of the element you want to evaluate. You indicate the type by
approach
to UMLtype
diagrams
placingAna integrated
colon (:) and
the classifier
after the label. Each element of the collection you are
evaluating must be of the specified type, or else the expression is undefined. You can rewrite the
Class and
Case,
Sequence,
Collaboration,
Statechart,
Activity,s:Component,
GPA example
to Object,
be evenUse
more
specific
and require
that it evaluate
only Student
and Deployment Diagrams
context
Course::getHonorsStudents(
) : Student
Extension
Mechanisms
body: self.students->select(curStudent : Student | curStudent.GPA > 3.0)
The Object Constraint Language (OCL)
Often you will need to express a constraint across an entire collection of objects, so OCL provides
theforAll operation that returns true if a given Boolean expression evaluates to true for all of the
If you're new to UML, a tutorial with realistic examples has even been included to help you
elements in a collection. The syntax for forAll is the same as that for select and reject. So, you
quickly familiarize yourself with the system.
can write a constraint that enforces that all students in a Course have paid their tuition:
context Course
inv: self.students->forAll(tuitionPaid = true)

www.it-ebooks.info

As you can with select, you can name and type the variable used in the expression:
UML 2.0 in a Nutshell
context Course
inv: self.students->forAll(curStudent
: Student | curStudent.tuitionPaid = true)
ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date:
June
If you need to check
to see
if 2005
there is at least one element in a collection that satisfies a boolean
0-596-00795-7
expression, youISBN:
can use
the operation exists. The syntax is the same as that for select. The
Pages:ensures
234
following expression
that at least one of the students has paid their tuition:

context Course
inv: self.students->exists(tuitionPaid = true)

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
Like
select, and
you document
can name systems.
and type The
the variables
used in Language
the expression:
construct,
Unified Modeling
(UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language
thatCourse
applies to a multitude of different systems. Essentially, it enables you to
context
communicate
solutions in a consistent, tool-supported
language.
inv: self.students->exists(curStudent
: Student
| curStudent.tuitionPaid = true)
Today, UML has become the standard method for modeling software systems, which means
you're
this rich
expressive
more
than or
ever
before.. And
You
canprobably
check to confronting
see if a collection
is and
empty
using thelanguage
operations
isEmpty
notEmpty
The
even
though
you
may
not
write
UML
diagrams
yourself,
you'll
still
need
to
interpret
following expression ensures that the school has at least one course offering:
diagrams written by others.
School from O'Reilly feels your pain. It's been crafted for professionals like
UMLcontext
2.0 in a Nutshell
self.Course->notEmpty(
)
you inv:
who must
read, create, and understand
system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

Colophon

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman

About the ...............................................


Author
Publisher:O'Reilly

Colophon Pub Date: June 2005


ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


Dan Pilone,Neil Pitman
About theBy
Author
...............................................
Publisher:O'Reilly
Date: June
2005 with Blueprint Technologies, Inc., cofounder and president
Dan Pilone is aPub
software
architect
ISBN:
0-596-00795-7
of Zizworks, Inc.,
and
a terrible rock climber. He has designed and implemented systems for
Hughes, ARINC,Pages:
UPS,234
and the Naval Research Laboratory. When not writing for O'Reilly, he
teaches software design and software engineering at the Catholic University in Washington,
D.C. He is the author of the UML Pocket Reference and has had several articles published
Table of Contents
| Index process, consulting in the software industry, and 3D graphics in Java.
covering
software

Neil Pitman is chief technical officer of Mahjong Mania, codeveloper of LamMDA from Mindset
Corporation,
and formerly
vice president
of researchfor
and
development
at Codagen
System developers
have used
modeling languages
decades
to specify,
visualize,
Technologies.
has 20 years
of experience
softwareLanguage
development
ranging
medical
construct, andNeil
document
systems.
The UnifiedinModeling
(UML)
is onefrom
of those
systems
to Smalltalk
development
gaming software
to code
he
languages.
UML makes
it possible platforms,
for team members
to collaborate
by generation.
providing a When
common
does
real work,
it's in J2EE
and XSLT as
well as UML.
Look Essentially,
for him at it enables you to
language
that applies
to a multitude
of different
systems.
http://www.architecturerules.com.
communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


Dan Pilone,Neil Pitman
ColophonBy
...............................................
Publisher:O'Reilly
Pub Date:
June 2005
Our look is the result
of reader
comments, our own experimentation, and feedback from
ISBN:0-596-00795-7
distribution channels.
Distinctive covers complement our distinctive approach to technical
Pages:
234
topics, breathing
personality
and life into potentially dry subjects.

The animal on the cover of UML 2.0 in a Nutshell is a chimpanzee (Pan troglodytes ).
Table of Contents | use
Indexa vast array of facial expressions, postures, and gestures to communicate
Chimpanzees
with each other, in addition to at least 32 different sounds. There is some evidence to suggest
that chimpanzees can learn symbolic languages.
System developers have used modeling languages for decades to specify, visualize,
The
naturaland
habitat
of the systems.
chimpanzee
western
Africa, from
Sierra(UML)
Leoneistoone
theofGreat
construct,
document
TheisUnified
Modeling
Language
thoseLakes
east
of the Congo.
Livingitprimarily
in forested
areas, chimpanzees
spend
50 to 70apercent
of
languages.
UML makes
possible for
team members
to collaborate
by providing
common
their
time in
trees.
They
omnivores,
eating primarily
fruits
and vegetables,
but
they
language
that
applies
toare
a multitude
of different
systems.
Essentially,
it enables
you
to will
also
hunt and eat
small animals.
They live
in family groups
that consist of about twice as
communicate
solutions
in a consistent,
tool-supported
language.
many females as males. While adult chimpanzees aren't monogamous, there's a close bond
between
a young
chimp and
parents,
and this
remains
unbroken
for life.
Today, UML
has become
theits
standard
method
forbond
modeling
software
systems,
which means
Chimpanzees
areconfronting
very sociable
and
affectionate
animals,
and frequently
stroke
each
you're probably
this
rich
and expressive
language
more thanhug,
everkiss,
before.
And
other,
or hold you
hands.
fights
often
break out
withinyou'll
a social
The
loser of the fight
even though
mayViolent
not write
UML
diagrams
yourself,
stillgroup.
need to
interpret
makes
up to
the winner
by displaying submissive behavior and conciliatory gestures. In this
diagrams
written
by others.
way they maintain the social harmony.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
Though
able
to,read,
the chimpanzee
walks system
erect onartifacts
both feet.
Short arm
muscles
you who
must
create, andrarely
understand
expressed
using
UML. prevent
simultaneous
of the
wriststo
and
fingers.
Because
this,
chimpanzees can't walk
Furthermore,extension
it's been fully
revised
cover
version
2.0 ofofthe
language.
with their hands flat; when walking on all fours, only the knuckles of their hands touch the
ground.
Unlike humannew
feet,
chimpanzee
also have
an opposing toe,
butUML
it's 2.0
useddiagram
mainly
This comprehensive
edition
not onlyfeet
provides
a quick-reference
to all
for
climbing
and
for
walking
on
precarious
footing.
The
foot
is
rarely
used
for
picking
up
types, it also explains key concepts in a way that appeals to readers already familiar with
objects.
UML or object-oriented programming concepts.
Mary Anne Weeks Mayo was the production editor and proofreader, and Audrey Doyle was the
Topics include:
copyeditor for UML 2.0 in a Nutshell . Phil Dangler and Colleen Gorman provided quality
control. Peter Ryan provided production assistance. Lucie Haskins wrote the index.
The role and value of UML in projects
Ellie Volckhausen designed the cover of this book, based on a series design by Edie
Freedman.
The cover image
is a 19th-century
engraving
The object-oriented
paradigm
and its relation
to thefrom
UMLthe Dover Pictorial Archive.
Karen Montgomery produced the cover layout with Adobe InDesign CS using Adobe's ITC
Garamond
font.
An integrated
approach to UML diagrams
David Class
Futatoand
designed
interior
ThisCollaboration,
book was converted
by Keith
Fahlgren
to
Object,the
Use
Case, layout.
Sequence,
Statechart,
Activity,
Component,
FrameMaker
5.5.6 with Diagrams
a format conversion tool created by Erik Ray, Jason McIntosh, Neil
and Deployment
Walls, and Mike Sierra that uses Perl and XML technologies. The text font is Linotype Birka;
Extension
the heading
font Mechanisms
is Adobe Myriad Condensed; and the code font is LucasFont's TheSans Mono
Condensed. The illustrations that appear in the book were produced by Robert Romano,
The Read,
Objectand
Constraint
Language
(OCL)
Jessamyn
Lesley Borash
using
Macromedia FreeHand MX and Adobe Photoshop CS.
The tip and warning icons were drawn by Christopher Bing. This colophon was written by
Clairemarie Fisher O'Leary.

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

#
(pound sign) 2nd
Table of Contents | Index
( ) parentheses 2nd
* (asterisk)
loop operator
System developers have used modeling languages for decades to specify, visualize,
looping constraints
construct, and document systems. The Unified Modeling Language (UML) is one of those
multiplicity value
languages. UML makes it possible for team members to collaborate by providing a common
OCL operator 2nd
language that applies to a multitude of different systems. Essentially, it enables you to
+ (plus sign)
communicate solutions in a consistent, tool-supported language.
OCL operator 2nd
visibility 2nd
Today, UML has become the standard method for modeling software systems, which means
, (comma) 2nd
you're probably confronting this rich and expressive language more than ever before. And
- (dash)
even though you may not write UML diagrams yourself, you'll still need to interpret
arguments and
diagrams written by others.
comments and
messages
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
visibility 2nd
you who must read, create, and understand system artifacts expressed using UML.
- (minus sign) 2nd
Furthermore, it's been fully revised to cover version 2.0 of the language.
. (dot) 2nd 3rd
/ (forward slash)
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
deferred events
types, it also explains key concepts in a way that appeals to readers already familiar with
derived notation
UML or object-oriented programming concepts.
OCL operator 2nd
property instances and
Topics include:
4+1 views
: (colon)
constraints
and and value of UML in projects
The role
interaction overview diagram
objectThe
names
and
object-oriented
paradigm and its relation to the UML
OCL and 2nd 3rd 4th
An integrated
approach to UML diagrams
parameter
name and 2nd
port typing
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
< (less than)
andkeyword
Deployment Diagrams
<<access>>
<<artifacts>> keyword
Extension
<<attribute>>
keywordMechanisms
<<bind>> keyword
The Object Constraint Language (OCL)
<<centralBuffer>> keyword
<<class>> keyword
<<component>> keyword
<<create>> keyword 2nd
If you're new to UML, a tutorial with realistic examples has even been included to help you
<<database system>> stereotype
quickly familiarize yourself with the system.
<<datastore>> keyword
<<decisionInput>> keyword
<<depends>> keyword
<<deploy>> keyword
<<deployment spec>> stereotype

www.it-ebooks.info

<<destroy>> message
<<device>> stereotype
<<exception>> keyword
UML 2.0 in a Nutshell
<<external>> keyword
<<import>> keyword ByDan Pilone,Neil Pitman
<<interface>> keyword
...............................................
Publisher:O'Reilly
<<iterative>> keyword
Date: June 2005
<<J2EE Containers>>Pub
stereotype
ISBN:
0-596-00795-7
<<localPostcondition>>
keyword
Pages:
234
<<localPrecondition>>
keyword
<<merge>> keyword
<<multicast>> keyword
Table of Contents |keyword
Index
<<multireceive>>
<<OS>> stereotype
<<parallel>> keyword
System developers
<<postcondition>>
keywordhave used modeling languages for decades to specify, visualize,
construct, and
document systems. The Unified Modeling Language (UML) is one of those
<<precondition>>
keyword
languages.
UML makes
<<provided
interfaces>>
keywordit possible for team members to collaborate by providing a common
language that
applies to a multitude of different systems. Essentially, it enables you to
<<realizations>>
keyword
communicate
solutions
<<required
interfaces>>
keywordin a consistent, tool-supported language.
<<selection>> keyword 2nd
Today, UML has become the standard method for modeling software systems, which means
<<singleton>>
you're probably
confronting this rich and expressive language more than ever before. And
<<transformation>>
keyword
=even
(equalsthough
sign) 2ndyou may not write UML diagrams yourself, you'll still need to interpret
written by others.
>diagrams
(angle brackets)
> (greater than)
UMLkeyword
2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
@pre
you operator
who must read, create, and understand system artifacts expressed using UML.
@pre
[]Furthermore,
(brackets) 2nd it's been fully revised to cover version 2.0 of the language.
_ (underscore)
This comprehensive
new edition not only provides a quick-reference to all UML 2.0 diagram
{protocol}
tag
| types,
(pipe) it also explains key concepts in a way that appeals to readers already familiar with
~UML
(tilde) or
2ndobject-oriented programming concepts.
(guillemots)

Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

abs(
) operation
Table of Contents | Index
abstract classes
interfaces as
naming conventions
System developers have used modeling languages for decades to specify, visualize,
overview
construct, and document systems. The Unified Modeling Language (UML) is one of those
Abstract Windowing Toolkit (AWT)
languages. UML makes it possible for team members to collaborate by providing a common
abstraction
language that applies to a multitude of different systems. Essentially, it enables you to
depicting
communicate solutions in a consistent, tool-supported language.
diagrams and 2nd
account, concept of
Today, UML has become the standard method for modeling software systems, which means
actions
you're probably confronting this rich and expressive language more than ever before. And
activity partitions
even though you may not write UML diagrams yourself, you'll still need to interpret
defined
diagrams written by others.
event occurrences
exception handlers
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
active state 2nd
you who must read, create, and understand system artifacts expressed using UML.
activities
Furthermore, it's been fully revised to cover version 2.0 of the language.
defined 2nd
overview 2nd 3rd
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
protocol state machines and
types, it also explains key concepts in a way that appeals to readers already familiar with
representation
UML or object-oriented programming concepts.
state machines and
transitions and
Topics include:
activity diagrams
actions
activities
The role and value of UML in projects
activity nodes
defined
The object-oriented paradigm and its relation to the UML
design view and
An integrated approach to UML diagrams
example
interaction overview diagrams
Class
and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
modeling
notations
and
Deployment
Diagrams
process
view
and
SPEM and
Extension Mechanisms
tokens
use cases and
The Object Constraint Language (OCL)
activity edges
activity final nodes
activity nodes
activity partitions 2nd
If you're new to UML, a tutorial with realistic examples has even been included to help you
actor generalization
quickly familiarize yourself with the system.
actors
generalization and
overview
use case diagrams and
use cases and

www.it-ebooks.info

acyclic graphs 2nd


adornments
after keyword
UML 2.0 in a Nutshell
aggregation
aliases, attributes andByDan Pilone,Neil Pitman
alt interaction operator
...............................................
Publisher:O'Reilly
alternatives
Pub3rd
Date: June 2005
and logical operator 2nd
angle brackets (>) ISBN:0-596-00795-7
Application Server Pages:234
arguments
boolean expressions and
Table
of Contents
| Index
interaction
occurrences
messages
arrows 2nd 3rd
System developers have used modeling languages for decades to specify, visualize,
artifacts
construct,
and document systems. The Unified Modeling Language (UML) is one of those
defined
languages.
UML makes it possible for team members to collaborate by providing a common
deployed
language
appliesand
to a multitude of different systems. Essentially, it enables you to
deploymentthat
specifications
communicate
nodes and 2nd solutions in a consistent, tool-supported language.
overview
Today,
UML has
representation
2nd become the standard method for modeling software systems, which means
you're connectors
probably 2nd
confronting this rich and expressive language more than ever before. And
assembly
eveninteraction
though operand
you may not write UML diagrams yourself, you'll still need to interpret
assert
diagrams
written
by others.
assert
interaction
operator
assertions 2nd
UML 2.0 classes
in a Nutshell
from O'Reilly feels your pain. It's been crafted for professionals like
association
2nd
you whoqualifiers
must read,
association
2nd create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
associations
actors and use cases 2nd
This
comprehensive
new edition not only provides a quick-reference to all UML 2.0 diagram
classifiers
and 2nd
types,
it also
explains key concepts in a way that appeals to readers already familiar with
instances
of
UML
or object-oriented programming concepts.
overview
representation 2nd 3rd
Topics
include:
states and
2nd
transitions and operations
asterisk (*)
The role and value of UML in projects
loop operator
looping constraints
The object-oriented paradigm and its relation to the UML
multiplicity value 2nd
OCL operator 2nd
An integrated approach to UML diagrams
asynchronous messages 2nd
attributeClass
notationand Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
attributesand Deployment Diagrams
activities and
association
classesMechanisms
and
Extension
class diagram and
classifiers
The and
Object Constraint Language (OCL)
compartments and
constraints on 2nd
defined
Ifderived
you're2nd
new to UML, a tutorial with realistic examples has even been included to help you
quickly
familiarize
yourself with the system.
events and
extending
inlined
mapping
mapping table rows to
multiplicity of

www.it-ebooks.info

parameters and
partitions and
postconditions of
preconditions of UML 2.0 in a Nutshell
properties of 2nd ByDan Pilone,Neil Pitman
return values and ...............................................
Publisher:O'Reilly
static
tagged values andPub Date: June 2005
ISBN:0-596-00795-7
attributes by relationship
Pages:234
inlined attributes and
overview 2nd
AWT (Abstract Windowing Toolkit)
Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

ball-and-socket
(lollipop) notation
Table of Contents | Index
assembly connectors 2nd
interfaces 2nd
port typing
System developers have used modeling languages for decades to specify, visualize,
behavior
construct, and document systems. The Unified Modeling Language (UML) is one of those
decision input
languages. UML makes it possible for team members to collaborate by providing a common
object flows and
language that applies to a multitude of different systems. Essentially, it enables you to
of activities
communicate solutions in a consistent, tool-supported language.
of classifiers 2nd
pseudostates and
Today, UML has become the standard method for modeling software systems, which means
real-time
you're probably confronting this rich and expressive language more than ever before. And
selection
even though you may not write UML diagrams yourself, you'll still need to interpret
transformation
diagrams written by others.
behavioral diagrams 2nd
behavioral modeling
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
behavioral ports
you who must read, create, and understand system artifacts expressed using UML.
behavioral state machines 2nd
Furthermore, it's been fully revised to cover version 2.0 of the language.
bidirectional ports
binding
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
black-box view (components)
types, it also explains key concepts in a way that appeals to readers already familiar with
body conditions
UML or object-oriented programming concepts.
body keyword
body subregion
Topics include:
boolean datatype 2nd
boolean expressions
constraints
and and value of UML in projects
The role
exists operation
forAllThe
operation
object-oriented paradigm and its relation to the UML
naming elements in
integrated approach to UML diagrams
state An
invariants
brackets [] 2nd
Class and
Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
break interaction
operator
breaks and Deployment Diagrams
bridges
Extension Mechanisms
build scripts

The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

C++
language
Table of Contents | Index
cancel event
casting 2nd
central buffer nodes
System developers have used modeling languages for decades to specify, visualize,
choice pseudostate
construct, and document systems. The Unified Modeling Language (UML) is one of those
CIM (computational-independent model)
languages. UML makes it possible for team members to collaborate by providing a common
class diagrams
language that applies to a multitude of different systems. Essentially, it enables you to
attributes
communicate solutions in a consistent, tool-supported language.
classes
considerations
Today, UML has become the standard method for modeling software systems, which means
database schemas
you're probably confronting this rich and expressive language more than ever before. And
defined
even though you may not write UML diagrams yourself, you'll still need to interpret
design view and
diagrams written by others.
interfaces
methods
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
operations
you who must read, create, and understand system artifacts expressed using UML.
purpose
Furthermore, it's been fully revised to cover version 2.0 of the language.
relationships
SPEM and
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
tagged values and
types, it also explains key concepts in a way that appeals to readers already familiar with
templates
UML or object-oriented programming concepts.
wallpaper diagrams
white-box view and
Topics include:
XML schemas
classes
abstract
3rd and value of UML in projects
The2nd
role
association 2nd
attributes
The object-oriented paradigm and its relation to the UML
class diagram and
An integrated
approach to UML diagrams
compartments
and
connectors and
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
defined
and Deployment
Diagrams
exceptions
and
extending 2nd
Extension Mechanisms
instances
mapping tables to
The Object Constraint Language (OCL)
methods and
objects and
operations and
Ifoverview
you're new to UML, a tutorial with realistic examples has even been included to help you
package merging and 2nd
quickly
familiarize yourself with the system.
parameterized
partitions and
relationships
structure and interrelationships
structured

www.it-ebooks.info

templates
white-box view and
classifier notation
UML 2.0 in a Nutshell
actors
extension points ByDan Pilone,Neil Pitman
use cases 2nd ...............................................
Publisher:O'Reilly
classifiers
Pub Date: June 2005
behavior of
ISBN:0-596-00795-7
classes as
Pages:234
collaboration occurrence
collections and
compartments
Table
of Contents
constraints
on | Index
dependencies
expression context and
System
interfacesdevelopers have used modeling languages for decades to specify, visualize,
construct,
and document systems. The Unified Modeling Language (UML) is one of those
mapping attributes
languages.
modeling andUML makes it possible for team members to collaborate by providing a common
language
OCL and that applies to a multitude of different systems. Essentially, it enables you to
communicate
partitions and solutions in a consistent, tool-supported language.
ports and
Today,
UML
states and
2ndhas
3rd become the standard method for modeling software systems, which means
you're
probably
confronting
CMS
(content
management
system) this rich and expressive language more than ever before. And
even
though you may not write UML diagrams yourself, you'll still need to interpret
code
generators
diagrams
written by others.
code
model (MDA)
collaboration diagram
UML 2.0 inoccurrences
a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
collaboration
you who must read, create, and understand system artifacts expressed using UML.
collaborations
Furthermore,
it's and
been fully revised to cover version 2.0 of the language.
composite structures
interactions and
This comprehensive
new edition not only provides a quick-reference to all UML 2.0 diagram
Collection
class
types, types
it also explains key concepts in a way that appeals to readers already familiar with
collection
UML or 2nd
object-oriented programming concepts.
collections
colon (:)
Topics
include:
constraints
and
interaction overview diagram
object names and
role
OCL The
and 2nd
3rdand
4th value of UML in projects
parameter name and 2nd
The object-oriented paradigm and its relation to the UML
port typing
submachine states
An integrated approach to UML diagrams
templated classes and
combined
fragments
Class
and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
extra-global
and Deployment Diagrams
interaction overview diagrams
overview
Extension Mechanisms
comma (,) 2nd
comments,
expressions
and
The
Object Constraint
Language (OCL)
communication diagrams
defined
interactions and 2nd
Ifoverview
you're new to UML, a tutorial with realistic examples has even been included to help you
quickly
familiarize
yourself with the system.
communication
paths
nodes and
overview 2nd
compartments
artifacts in
classes and

www.it-ebooks.info

classifiers and
components and 2nd
decomposition
operations and UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
states and
completion event
...............................................
O'Reilly
completion transition Publisher:
2nd
component diagramsPub Date: June 2005
component views ISBN:0-596-00795-7
Pages:234
components
defined
deployment view and
Table
of Contents | Index
linking
SPEM and
components
System
developers have used modeling languages for decades to specify, visualize,
artifacts and
construct,
and document systems. The Unified Modeling Language (UML) is one of those
black-box view
languages.
UML makes it possible for team members to collaborate by providing a common
defined
language
overview that applies to a multitude of different systems. Essentially, it enables you to
communicate
solutions in a consistent, tool-supported language.
stereotypes
white-box view
Today, icon
UML has become the standard method for modeling software systems, which means
composite
you're probably
confronting this rich and expressive language more than ever before. And
composite
property (attributes)
even though
composite
states you may not write UML diagrams yourself, you'll still need to interpret
diagrams
written by others.
defined
overview
UML
2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
transitions
you who
must diagrams
read, create, and understand system artifacts expressed using UML.
composite
structure
Furthermore,
it's been fully revised to cover version 2.0 of the language.
defined
design view and
This
comprehensive
implementation
view and new edition not only provides a quick-reference to all UML 2.0 diagram
types,
it also
explains
key concepts in a way that appeals to readers already familiar with
relationships
between
properties
UML or structures
object-oriented programming concepts.
composite
collaboration occurrences
Topics
include:
collaborations
connectors
ports and
The role and value of UML in projects
properties
structured classes
The object-oriented paradigm and its relation to the UML
composition relationship 2nd
compound transition
An integrated approach to UML diagrams
computational-independent model (CIM)
concat( )Class
operation
and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
conditionals,
2nd
andOCL
Deployment
Diagrams
conditions
extension
points and
Extension
Mechanisms
invariant
labelsThe
and Object Constraint Language (OCL)
transitions and
configuration
deployment diagrams and
Ifexecution
you're new
to UML, a tutorial with realistic examples has even been included to help you
environments
quickly
familiarize
implementation view yourself with the system.
state
transitions and
connection points 2nd
connector ends
connectors

www.it-ebooks.info

assembly
composite structures and
defined 2nd
UML 2.0 in a Nutshell
multiple

ByDan Pilone,Neil Pitman


ports and 2nd
consider interaction operator
...............................................
Publisher:O'Reilly
constants
parameters and Pub Date: June 2005
0-596-00795-7
readOnly attributeISBN:
property
and
Pages:234
value pin
constraints
attributes and 2nd 3rd 4th
Table
of Contents
collections
and| Index
looping
on classifiers
System
operationdevelopers
2nd 3rd 4th have used modeling languages for decades to specify, visualize,
construct,
overview and document systems. The Unified Modeling Language (UML) is one of those
languages.
partitions andUML makes it possible for team members to collaborate by providing a common
language
profiles andthat
2nd applies to a multitude of different systems. Essentially, it enables you to
communicate
in a consistent, tool-supported language.
sequence timing solutions
and
time
Today,
UML has become the standard method for modeling software systems, which means
transitions
you'remanagement
probablysystem
confronting
content
(CMS) this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
context
diagrams
written by others.
activities and
of expressions 2nd 3rd
UML 2.0
in a(OCL)
Nutshell
context
keyword
2nd from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
continuations
Furthermore,
it's been fully revised to cover version 2.0 of the language.
control
flow
control nodes
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
CppDoc
types,
it alsooperand
explains key concepts in a way that appeals to readers already familiar with
critical
interaction
UML interaction
or object-oriented
critical
operator 2nd programming concepts.
critical regions 2nd
Topics
include:
curly
braces
{}
constraints and
extended keyword
The role and value of UML in projects
properties
property strings
The object-oriented paradigm and its relation to the UML
protocol keyword
state invariants
An integrated approach to UML diagrams
stream keyword
weights
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,

and Deployment Diagrams


Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

dash
(-)
Table of Contents | Index
arguments and
comments and
messages
System developers have used modeling languages for decades to specify, visualize,
visibility 2nd
construct, and document systems. The Unified Modeling Language (UML) is one of those
data store nodes
languages. UML makes it possible for team members to collaborate by providing a common
database modeling
language that applies to a multitude of different systems. Essentially, it enables you to
database schemas
communicate solutions in a consistent, tool-supported language.
database testing
decision input behavior
Today, UML has become the standard method for modeling software systems, which means
decision nodes 2nd
you're probably confronting this rich and expressive language more than ever before. And
decomposition
even though you may not write UML diagrams yourself, you'll still need to interpret
decomposition compartment
diagrams written by others.
deep history pseudostate
def keyword
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
default entry
you who must read, create, and understand system artifacts expressed using UML.
default_value element (operations)
Furthermore, it's been fully revised to cover version 2.0 of the language.
defer keyword
deferred events 2nd
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
dependency relationship
types, it also explains key concepts in a way that appeals to readers already familiar with
classifiers
UML or object-oriented programming concepts.
components 2nd
defined
Topics include:
interfaces
representation 2nd
stereotypes
and and value of UML in projects
The role
dependency relationships
classThe
diagram
and
object-oriented
paradigm and its relation to the UML
depicting
An integrated approach to UML diagrams
depicting
multiple
deployedClass
artifactand Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
deployment
code model and
Extension Mechanisms
deployment
deployment view and
The Object Constraint Language (OCL)
nodes and
overview
variations on 2nd
deployment diagrams
If you're new to UML, a tutorial with realistic examples has even been included to help you
artifacts and
quickly
familiarize yourself with the system.
defined
deployment specifications 2nd 3rd
deployment target
deployment view
derive keyword

www.it-ebooks.info

derived attributes 2nd


derived property (attributes)
design decisions
UML 2.0 in a Nutshell
design view

ByDan Pilone,Neil Pitman


devices, nodes and 2nd
Diagram Interchange...............................................
Specification
Publisher:O'Reilly
diagrams
Pub Date: June 2005
abstraction and 2nd
as building blocks ISBN:0-596-00795-7
Pages:234
defined
diagrams
exception handling
Table
of Contents
| Index and
missing
compartments
modeling and
models versus
System
developers have used modeling languages for decades to specify, visualize,
notes
construct,
notes and and document systems. The Unified Modeling Language (UML) is one of those
languages.
overview 2ndUML makes it possible for team members to collaborate by providing a common
language
that applies to a multitude of different systems. Essentially, it enables you to
sprawling scope
communicate
solutions in a consistent, tool-supported language.
static
UML and
Today,
UML has become the standard method for modeling software systems, which means
use cases
you're
probably confronting this rich and expressive language more than ever before. And
views 2nd
even
though you may not write UML diagrams yourself, you'll still need to interpret
wallpaper
diagrams
written by others.
direct
substates
directed dependency graphs
UML 2.0
in a (operations)
Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
direction
element
you whoevents
must2nd
read, create, and understand system artifacts expressed using UML.
dispatching
Furthermore,
it's been fully revised to cover version 2.0 of the language.
do
activity 2nd
documentation
This
comprehensive
new edition not only provides a quick-reference to all UML 2.0 diagram
diagrams
and
types,
it also explains key concepts in a way that appeals to readers already familiar with
use cases
UML
or 3rd
object-oriented programming concepts.
dot
(.) 2nd
Doxygen tool
Topics include:
DTDs

The role and value of UML in projects


The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

EAI
(Enterprise Application Integration)
Table of Contents | Index
edges, activity
effect activity (transition) 2nd
elements
System developers have used modeling languages for decades to specify, visualize,
collections and
construct, and document systems. The Unified Modeling Language (UML) is one of those
interaction diagrams and
languages. UML makes it possible for team members to collaborate by providing a common
naming
language that applies to a multitude of different systems. Essentially, it enables you to
overview
communicate solutions in a consistent, tool-supported language.
profiles and
stereotypes and 2nd 3rd
Today, UML has become the standard method for modeling software systems, which means
encapsulation
you're probably confronting this rich and expressive language more than ever before. And
Enterprise Application Integration (EAI)
even though you may not write UML diagrams yourself, you'll still need to interpret
entity component
diagrams written by others.
Entity Relation Diagrams (ERDs)
entry activity
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
protocol state machines and 2nd
you who must read, create, and understand system artifacts expressed using UML.
transitions and
Furthermore, it's been fully revised to cover version 2.0 of the language.
triggers for
Entry pseudostate 2nd
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
equals sign (=) 2nd
types, it also explains key concepts in a way that appeals to readers already familiar with
ERDs (Entity Relation Diagrams)
UML or object-oriented programming concepts.
event occurrences
assertions and
Topics include:
critical regions 2nd
general ordering
looping
2ndrole and value of UML in projects
The
negative
overview
The object-oriented paradigm and its relation to the UML
parallel execution
An integrated
approach to UML diagrams
sequence
timing
strict sequencing
tracesClass and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
Deployment Diagrams
weakand
sequencing
events
Extension
Mechanisms
as triggers
2nd
completion
The Object Constraint Language (OCL)
mapping parameters
processing
transitions and
exception handlers
If you're new to UML, a tutorial with realistic examples has even been included to help you
activity diagrams and
quickly
familiarize yourself with the system.
modeling mechanism
exception pins
exceptions, operations and
execution environment 2nd
execution occurrences

www.it-ebooks.info

execution occurrences
expansion regions and
overview
UML 2.0 in a Nutshell
streaming

ByDan Pilone,Neil Pitman


exists operation
exit activity
...............................................
Publisher:
protocol state machines
and O'Reilly
Pub Date: June 2005
transitions and 2nd
ISBN:0-596-00795-7
triggers for
Exit pseudostate 2ndPages:234
expansion regions 2nd
explicit binding
Table ofentry
Contents | Index
explicit
expressions
as invariants
System
have used modeling languages for decades to specify, visualize,
attributesdevelopers
and
construct,
comments inand document systems. The Unified Modeling Language (UML) is one of those
languages.
context of 2ndUML
3rd makes it possible for team members to collaborate by providing a common
language
declaring that applies to a multitude of different systems. Essentially, it enables you to
communicate
evaluating 2nd solutions in a consistent, tool-supported language.
grouping
Today,
naming UML has become the standard method for modeling software systems, which means
you're
namingprobably
elements confronting this rich and expressive language more than ever before. And
even
though
you may not write UML diagrams yourself, you'll still need to interpret
OCL and
2nd 3rd
diagrams
written by others.
operations and
undefined
UML
2.0 in
variables
in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who
must read, create, and understand system artifacts expressed using UML.
extend
keyword
Furthermore,
extended
keyword it's been fully revised to cover version 2.0 of the language.
extends keyword
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
extension
types,
it also explains key concepts in a way that appeals to readers already familiar with
state machines
UML
or object-oriented
programming concepts.
use case
2nd
extension points 2nd
Topicsstate
include:
external
extra-global combined fragments

The role and value of UML in projects


The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

final
state 2nd
Table of Contents | Index
floor( ) operation
flow final nodes
focus of control 2nd 3rd
System developers have used modeling languages for decades to specify, visualize,
forAll operation
construct, and document systems. The Unified Modeling Language (UML) is one of those
foreign keys
languages. UML makes it possible for team members to collaborate by providing a common
fork and join pseudostate
language that applies to a multitude of different systems. Essentially, it enables you to
fork nodes 2nd
communicate solutions in a consistent, tool-supported language.
forward slash (/)
deferred events
Today, UML has become the standard method for modeling software systems, which means
derived notation
you're probably confronting this rich and expressive language more than ever before. And
OCL operator 2nd
even though you may not write UML diagrams yourself, you'll still need to interpret
property instances and
diagrams written by others.
found messages 2nd
functions

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

gates
Table of Contents | Index
general ordering
generalization relationship
casting and
System developers have used modeling languages for decades to specify, visualize,
defined
construct, and document systems. The Unified Modeling Language (UML) is one of those
package merging and
languages. UML makes it possible for team members to collaborate by providing a common
representation
language that applies to a multitude of different systems. Essentially, it enables you to
generalization, use case and actor
communicate solutions in a consistent, tool-supported language.
graphical representation
greater than (>)
Today, UML has become the standard method for modeling software systems, which means
guard condition
you're probably confronting this rich and expressive language more than ever before. And
brackets and
even though you may not write UML diagrams yourself, you'll still need to interpret
communication diagrams
diagrams written by others.
decision nodes and
edges and
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
interaction fragments and
you who must read, create, and understand system artifacts expressed using UML.
interaction operators and
Furthermore, it's been fully revised to cover version 2.0 of the language.
ordering
syntax
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
transitions 2nd
types, it also explains key concepts in a way that appeals to readers already familiar with
guillemots

UML or object-oriented programming concepts.


Topics include:
The role and value of UML in projects

The object-oriented paradigm and its relation to the UML


An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

high-level
transition
Table of Contents | Index
HyperModel
hyphen (-)
arguments and
System developers have used modeling languages for decades to specify, visualize,
messages
construct, and document systems. The Unified Modeling Language (UML) is one of those
visibility 2nd

languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

if-then-else
logical operator
Table of Contents | Index
if-then-else-endif keywords
if-then-else-endif operator
ignore interaction operator 2nd
System developers have used modeling languages for decades to specify, visualize,
implementation
construct, and document systems. The Unified Modeling Language (UML) is one of those
defined
languages. UML makes it possible for team members to collaborate by providing a common
functionality and
language that applies to a multitude of different systems. Essentially, it enables you to
state machines and
communicate solutions in a consistent, tool-supported language.
implementation diagrams
implementation view
Today, UML has become the standard method for modeling software systems, which means
implicit binding
you're probably confronting this rich and expressive language more than ever before. And
implies keyword
even though you may not write UML diagrams yourself, you'll still need to interpret
implies logical operator 2nd 3rd
diagrams written by others.
importing packages 2nd
in keyword
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
inactive state
you who must read, create, and understand system artifacts expressed using UML.
include keyword
Furthermore, it's been fully revised to cover version 2.0 of the language.
includes keyword
inclusion, use case
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
indirect substates
types, it also explains key concepts in a way that appeals to readers already familiar with
inheritance
UML or object-oriented programming concepts.
classes and
decomposition and
Topics include:
init keyword
initial nodes
initial pseudostate
The role2nd
and value of UML in projects
inlined attributes
inout keyword
2nd
The object-oriented
paradigm and its relation to the UML
input pins
An integrated
approach to UML diagrams
expansion
regions
object nodes and
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
representation
and Deployment Diagrams
streaming
instances
Extension Mechanisms
artifact
collaboration
The Object Constraint Language (OCL)
collaboration occurrences as
collections and
composite structures and
and
Ifconnectors
you're new
to UML, a tutorial with realistic examples has even been included to help you
defined 2nd
quickly familiarize yourself with the system.
interactions and
lifelines and
multiple
operations and
relative times

www.it-ebooks.info

representation
XML documents as
instantiation
UML 2.0 in a Nutshell
integer datatype
interaction diagrams ByDan Pilone,Neil Pitman
alternate notations...............................................
Publisher:O'Reilly
combined fragments
Pub Date: June 2005
continuations
ISBN:0-596-00795-7
decomposition
Pages:234
deployment view and
event occurrences
example
Table
of Contents
| Index
execution
occurrences
implementation view and
interaction occurrences 2nd
System
developers
have used modeling languages for decades to specify, visualize,
interactions
2nd
construct,
messages and document systems. The Unified Modeling Language (UML) is one of those
languages.
participants UML makes it possible for team members to collaborate by providing a common
language
that
process view
andapplies to a multitude of different systems. Essentially, it enables you to
communicate
sequence timing solutions in a consistent, tool-supported language.
state invariants
Today,
traces UML has become the standard method for modeling software systems, which means
you're
probably
use case
view and confronting this rich and expressive language more than ever before. And
even
though
use cases
and you may not write UML diagrams yourself, you'll still need to interpret
diagrams
written by others.
interaction
fragments
communication diagrams and
UML
2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
defined
you
who
must read,
event
occurrences
and create, and understand system artifacts expressed using UML.
Furthermore,
it's been fully revised to cover version 2.0 of the language.
gates and
guard conditions and 2nd
This
comprehensive
new edition not only provides a quick-reference to all UML 2.0 diagram
messages
and 2nd 3rd 4th
types,
also explains key concepts in a way that appeals to readers already familiar with
optionsitand
UML
or execution
object-oriented programming concepts.
parallel
interaction occurrences 2nd
Topics include:
interaction
operands
breaks
critical
The role and value of UML in projects
defined
parallel execution
The object-oriented paradigm and its relation to the UML
weak sequencing
interaction operators
An integrated approach to UML diagrams
defined
guardClass
conditions
and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
messages
and and
Deployment Diagrams
interaction overview diagrams 2nd 3rd
interaction
points 2nd Mechanisms
Extension
interactions
alternate
Thenotations
Object Constraint Language (OCL)
copying
overview 2nd
participants
Ifsequence
you're new
to UML,
a tutorial with realistic examples has even been included to help you
diagrams
and
quickly
familiarize
yourself
with the system.
interfaces
as classifiers
black-box view
collaborations and
connection points and
dependencies

www.it-ebooks.info

ports and 2nd


representation
SPEM and
white-box view UML 2.0 in a Nutshell
ByDan Pilone,Neil Pitman
internal activities compartment
internal transitions 2nd
...............................................
Publisher:O'Reilly
interruptible activity regions
inv keyword (OCL) Pub Date: June 2005
invariant condition ISBN:0-596-00795-7
Pages:234
invariants
assertions and
constraints as
Table
of Contentsas| Index
expressions
overview
states and
System
developers have used modeling languages for decades to specify, visualize,
isEmpty(
) operation

construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

J2EE
(Java 2 Enterprise Edition)
Table of Contents | Index
J2EE Container
java.util package
Javadoc tool
System developers have used modeling languages for decades to specify, visualize,
join nodes 2nd
construct, and document systems. The Unified Modeling Language (UML) is one of those
join specification
languages. UML makes it possible for team members to collaborate by providing a common
junction pseudostate

language that applies to a multitude of different systems. Essentially, it enables you to


communicate solutions in a consistent, tool-supported language.

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

keys
2nd
Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

labels
2nd 3rd
Table of Contents | Index
language constructs 2nd
less than (<)
let keyword
System developers have used modeling languages for decades to specify, visualize,
lifelines
construct, and document systems. The Unified Modeling Language (UML) is one of those
communication between
languages. UML makes it possible for team members to collaborate by providing a common
decomposed
language that applies to a multitude of different systems. Essentially, it enables you to
defined
communicate solutions in a consistent, tool-supported language.
guard conditions
interaction overview diagram
Today, UML has become the standard method for modeling software systems, which means
labels and
you're probably confronting this rich and expressive language more than ever before. And
representation
even though you may not write UML diagrams yourself, you'll still need to interpret
stacking
diagrams written by others.
state invariants and
state variants and
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
strict sequencing and
you who must read, create, and understand system artifacts expressed using UML.
timing diagrams and
Furthermore, it's been fully revised to cover version 2.0 of the language.
lifelines keyword
local variables
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
logical operators
types, it also explains key concepts in a way that appeals to readers already familiar with
loop interaction operator 2nd 3rd
UML or object-oriented programming concepts.
loop nodes
looping
Topics include:
activity diagrams
constraints and
eventThe
occurrences
2ndvalue of UML in projects
role and
interaction overview diagram
lost messages
2nd
The object-oriented
paradigm and its relation to the UML

An integrated approach to UML diagrams


Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

M0
model 2nd
Table of Contents | Index
M1 model 2nd 3rd
M2 model 2nd 3rd
M3 model
System developers have used modeling languages for decades to specify, visualize,
manifest keyword
construct, and document systems. The Unified Modeling Language (UML) is one of those
manifestation
languages. UML makes it possible for team members to collaborate by providing a common
mapping model
language that applies to a multitude of different systems. Essentially, it enables you to
marking model
communicate solutions in a consistent, tool-supported language.
marks 2nd
MDA (Model-Driven Architecture)
Today, UML has become the standard method for modeling software systems, which means
design decisions
you're probably confronting this rich and expressive language more than ever before. And
formal transformation language
even though you may not write UML diagrams yourself, you'll still need to interpret
functionality
diagrams written by others.
models
overview 2nd
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
UML and
you who must read, create, and understand system artifacts expressed using UML.
merge nodes 2nd
Furthermore, it's been fully revised to cover version 2.0 of the language.
merging packages 2nd
messages
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
as gates
types, it also explains key concepts in a way that appeals to readers already familiar with
considering
UML or object-oriented programming concepts.
destroy
event occurrences
Topics include:
execution occurrences
ignoring 2nd
interaction
diagrams
The role
andand
value of UML in projects
interaction fragments
nested
callsobject-oriented paradigm and its relation to the UML
The
overview
timingAn
of integrated approach to UML diagrams
metamodels 2nd
Class
method calls
2ndand Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
methodsand
2nd Deployment Diagrams
minus sign (-) 2nd
Extension Mechanisms
model elaboration
modeling
The Object Constraint Language (OCL)
activity 2nd
adornments
behavioral
Ifclassifiers
you're new to UML, a tutorial with realistic examples has even been included to help you
defined
quickly
familiarize yourself with the system.
Diagram Interchange Specification
models
connecting
diagrams versus
MDA

www.it-ebooks.info

OCL 2nd
transforming
MOF (Meta-Object Facility)
UML 2.0 in a Nutshell
CIM and

ByDan Pilone,Neil Pitman


example
functionality
...............................................
Publisher:O'Reilly
OCL and
Pub Date: June 2005
multicasting
ISBN:0-596-00795-7
multidimensional partitions
Pages:234
multiplicity
aggregation and
associations and 2nd 3rd
Table
of Contents and
| Index
compositions
connector ends
generalization relationships and
System
developers have used modeling languages for decades to specify, visualize,
of attributes
construct,
and document systems. The Unified Modeling Language (UML) is one of those
port
languages.
UML makes it possible for team members to collaborate by providing a common
properties
language
that2nd
applies
to a multitude of different systems. Essentially, it enables you to
representation
3rd
communicate
solutions in a consistent, tool-supported language.
XML elements and
multiplicity element (operations)

Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

name
compartment
Table of Contents | Index
name element (operations)
names
association classes and
System developers have used modeling languages for decades to specify, visualize,
attribute syntax element 2nd
construct, and document systems. The Unified Modeling Language (UML) is one of those
connectors and
languages. UML makes it possible for team members to collaborate by providing a common
elements
language that applies to a multitude of different systems. Essentially, it enables you to
postcondition
communicate solutions in a consistent, tool-supported language.
precondition
qualifying
Today, UML has become the standard method for modeling software systems, which means
state
you're probably confronting this rich and expressive language more than ever before. And
use cases and 2nd
even though you may not write UML diagrams yourself, you'll still need to interpret
variable 2nd
diagrams written by others.
naming conventions
abstract classes 2nd
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
associations
you who must read, create, and understand system artifacts expressed using UML.
concrete models and
Furthermore, it's been fully revised to cover version 2.0 of the language.
naming conventions
operation syntax elements
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
operations
types, it also explains key concepts in a way that appeals to readers already familiar with
parameters
UML or object-oriented programming concepts.
preconditions of
representation
Topics include:
state machines
navigability
aggregation
and and value of UML in projects
The role
associations and
compositions
and
The object-oriented
paradigm and its relation to the UML
neg interaction operator
nesting An integrated approach to UML diagrams
devices
Class
and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
message
calls
and Deployment Diagrams
stereotypes
nodes
Extension Mechanisms
activity
artifacts and
The Object Constraint Language (OCL)
central buffer
data store
defined
handling
Ifexception
you're new
to UML, a tutorial with realistic examples has even been included to help you
overview
quickly familiarize yourself with the system.
representation 2nd
not logical operator
not operator
notEmpty( ) operation 2nd
notes

www.it-ebooks.info

modeling and
specifying constraints in
state invariants and
UML 2.0 in a Nutshell
number datatype

ByDan Pilone,Neil Pitman


...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

object
diagrams
Table of Contents | Index
defined
design view and
unnamed objects in
System developers have used modeling languages for decades to specify, visualize,
object flows
construct, and document systems. The Unified Modeling Language (UML) is one of those
object nodes
languages. UML makes it possible for team members to collaborate by providing a common
Object Oriented Analysis and Design (OOAD) 2nd
language that applies to a multitude of different systems. Essentially, it enables you to
objects
communicate solutions in a consistent, tool-supported language.
abstract classes and
actions and
Today, UML has become the standard method for modeling software systems, which means
built-in properties
you're probably confronting this rich and expressive language more than ever before. And
casting
even though you may not write UML diagrams yourself, you'll still need to interpret
constraints and
diagrams written by others.
defined 2nd
displaying multiple
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
execution occurrences
you who must read, create, and understand system artifacts expressed using UML.
gates and
Furthermore, it's been fully revised to cover version 2.0 of the language.
lifelines and
method calls between
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
representation 2nd 3rd
types, it also explains key concepts in a way that appeals to readers already familiar with
tokens
UML or object-oriented programming concepts.
OCL (Object Constraint Language)
advanced modeling
Topics include:
as UML specification 2nd
basic types
defined
The role and value of UML in projects
overview
syntax
The object-oriented paradigm and its relation to the UML
oclAsType property (OCL)
Anproperty
integrated
oclInState
(OCL) approach to UML diagrams
oclIsKindOf property (OCL)
and
Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
oclIsNewClass
property
(OCL)
andproperty
Deployment
Diagrams
oclIsTypeOf
(OCL)
OMG (Object Management Group)
Mechanisms
MDA Extension
and 2nd
OCL and
The Object Constraint Language (OCL)
SPEM and
UML and 2nd
OOAD (Object Oriented Analysis and Design) 2nd
operations
If you're new to UML, a tutorial with realistic examples has even been included to help you
activities and
quickly
familiarize yourself with the system.
class diagram and
collaboration occurrence
Collection class
compartments and
constraints on 2nd 3rd 4th

www.it-ebooks.info

methods and
OCL properties and
static
syntax elements UML 2.0 in a Nutshell
transitions and ByDan Pilone,Neil Pitman
opt interaction operator
...............................................
Publisher:O'Reilly
options
or logical operator Pub Date: June 2005
ISBN:0-596-00795-7
logic rules
Pages:234
OCL and 2nd
order of precedence
ordered property
Table
of Contents
attributes
2nd | Index
operations
ordering
System
developers
asynchronous
messageshave
and used modeling languages for decades to specify, visualize,
construct,
and document systems. The Unified Modeling Language (UML) is one of those
general
languages.
UML makes it possible for team members to collaborate by providing a common
guard conditions
language
that applies to a multitude of different systems. Essentially, it enables you to
representation
communicate
solutions
in a consistent, tool-supported language.
orthogonal
composite
state
conflicting transitions and
Today,
defined UML
2nd has become the standard method for modeling software systems, which means
you're
probably
confronting this rich and expressive language more than ever before. And
transitions
2nd
even
though
out
keyword
2nd you may not write UML diagrams yourself, you'll still need to interpret
diagrams
output
pins written by others.
expansion regions
UML
2.0
in aand
Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
object
nodes
you
who must read, create, and understand system artifacts expressed using UML.
representation
Furthermore,
it's been fully revised to cover version 2.0 of the language.
streaming
ownership 2nd

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

package
diagrams
Table of Contents | Index
defined
directed dependency graphs
functionality
System developers have used modeling languages for decades to specify, visualize,
importing and accessing 2nd
construct, and document systems. The Unified Modeling Language (UML) is one of those
merging 2nd
languages. UML makes it possible for team members to collaborate by providing a common
representation 2nd
language that applies to a multitude of different systems. Essentially, it enables you to
SPEM and
communicate solutions in a consistent, tool-supported language.
structuring projects with
use case packages
Today, UML has become the standard method for modeling software systems, which means
visibility 2nd
you're probably confronting this rich and expressive language more than ever before. And
packages
even though you may not write UML diagrams yourself, you'll still need to interpret
defined
diagrams written by others.
directed dependency graphs
importing and accessing 2nd
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
merging 2nd
you who must read, create, and understand system artifacts expressed using UML.
representation 2nd
Furthermore, it's been fully revised to cover version 2.0 of the language.
structuring projects with
use case
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
visibility 2nd
types, it also explains key concepts in a way that appeals to readers already familiar with
packages visibility 2nd
UML or object-oriented programming concepts.
par interaction operator
parallel execution
Topics include:
parameter nodes 2nd
parameter sets
parameter_name
(operations)
The roleelement
and value
of UML in projects
parameterized classes
parameters
The object-oriented paradigm and its relation to the UML
activities and
Anand
integrated approach to UML diagrams
events
interaction occurrences
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
mapping
and
Deployment
Diagrams
method
calls
and
parentheses ( ) 2nd
Extension Mechanisms
part decomposition
participants
The Object Constraint Language (OCL)
partitions, activity
PIM (Platform-Independent Model) 2nd
pins
pipe (|)
If you're new to UML, a tutorial with realistic examples has even been included to help you
Platform-Independent Model (PIM) 2nd
quickly familiarize yourself with the system.
Platform-Specific Model (PSM) 2nd
plus sign (+)
OCL operator 2nd
visibility 2nd
ports

www.it-ebooks.info

bidirectional
composite structures and
connectors and
UML 2.0 in a Nutshell
defined

ByDan Pilone,Neil Pitman


post keyword
postconditions
...............................................
Publisher:O'Reilly
actions and
Pub Date: June 2005
activities and
ISBN:0-596-00795-7
naming
Pages:234
OCL expressions and
OCL properties and
operation constraints
Table
of Contents
| Index
protocol
state machines
pound sign (#) 2nd
pre keyword
System developers have used modeling languages for decades to specify, visualize,
preconditions
construct,
actions and and document systems. The Unified Modeling Language (UML) is one of those
languages.
activities and UML makes it possible for team members to collaborate by providing a common
language
that applies to a multitude of different systems. Essentially, it enables you to
naming
communicate
in a consistent, tool-supported language.
OCL expressionssolutions
and
operation constraints
Today,
has become the standard method for modeling software systems, which means
protocolUML
state machines
you'rekeys
probably
confronting this rich and expressive language more than ever before. And
primary
2nd
evenvisibility
though
private
2ndyou
3rd may not write UML diagrams yourself, you'll still need to interpret
diagrams
written by others.
process
component
process view
UML 2.0 in a data
Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
process-relevant
you who must read, create, and understand system artifacts expressed using UML.
profiles
Furthermore,
constraints and it's been fully revised to cover version 2.0 of the language.
defined 2nd
This
comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
overview
types,
it also explains key concepts in a way that appeals to readers already familiar with
tools and
UML
usesor
for object-oriented programming concepts.
programming languages
Topics
include:
code model
efficiency of
importing packages
Thesupport
role and value of UML in projects
interface
multiple inheritance support
The object-oriented paradigm and its relation to the UML
OCL logic rules
PIM and
An integrated approach to UML diagrams
query-only
UML Class
and
and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
projects,and
structuring
Deployment Diagrams
properties
artifacts
Extension Mechanisms
associations and
attribute
The2nd
Object Constraint Language (OCL)
composite structures and
dots and
interfaces and 2nd
IfOCL
you're new to UML, a tutorial with realistic examples has even been included to help you
quickly
familiarize
yourself with the system.
properties element
(operations)
property strings element
protected visibility 2nd
protocol keyword
protocol state machines
defined

www.it-ebooks.info

overview 2nd
real-time systems and
provided interfaces
UML
assembly connector
and2.0 in a Nutshell

ByDan Pilone,Neil Pitman


compartments
components and ...............................................
Publisher:O'Reilly
ports and 2nd
Pub Date: June 2005
pseudostates
0-596-00795-7
connection points ISBN:
and 2nd
Pages:234
initial
overview
state machine extensions
Table
of Contents
Index
state
machines| and
transitions
PSM (Platform-Specific Model) 2nd
System
developers
have used modeling languages for decades to specify, visualize,
public
visibility
2nd 3rd

construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

qualifiers,
association 2nd
Table of Contents | Index
query constraint
query method
query operations 2nd
System developers have used modeling languages for decades to specify, visualize,
query-only languages

construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

Rational
Unified Process (RUP)
Table of Contents | Index
readOnly property 2nd 3rd
real datatype
real-time behavior
System developers have used modeling languages for decades to specify, visualize,
realization compartment
construct, and document systems. The Unified Modeling Language (UML) is one of those
realization component
languages. UML makes it possible for team members to collaborate by providing a common
redefines property (attributes)
language that applies to a multitude of different systems. Essentially, it enables you to
ref interaction_diagram_name
communicate solutions in a consistent, tool-supported language.
regions
composite states and
Today, UML has become the standard method for modeling software systems, which means
critical 2nd
you're probably confronting this rich and expressive language more than ever before. And
expansion 2nd
even though you may not write UML diagrams yourself, you'll still need to interpret
final state
diagrams written by others.
interruptible activity
representation 2nd
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
state machine extensions
you who must read, create, and understand system artifacts expressed using UML.
reject( ) operation
Furthermore, it's been fully revised to cover version 2.0 of the language.
relationship notation 2nd
relationships
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
actors and use cases
types, it also explains key concepts in a way that appeals to readers already familiar with
aggregation
UML or object-oriented programming concepts.
artifacts and nodes
association 2nd
Topics include:
association classes 2nd
association qualifiers 2nd
attributes
2nd and
3rd value of UML in projects
Thebyrole
class diagram and
classes
andobject-oriented paradigm and its relation to the UML
The
composition 2nd
An integrated approach to UML diagrams
dependency
generalization
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
properties
and Deployment Diagrams
pseudostates
state machines
Mechanisms
UML Extension
modeling
required hardware node
The Object Constraint Language (OCL)
required interfaces
assembly connector and
compartments
and
Ifcomponents
you're new
to UML, a tutorial with realistic examples has even been included to help you
ports and 2nd
quickly familiarize yourself with the system.
required software node
result keyword (OCL)
return values
interactions and 2nd
local variables

www.it-ebooks.info

messages
of operations
representation
UML 2.0 in a Nutshell
return-type element (operations)
reverse engineering ByDan Pilone,Neil Pitman
clutter and
...............................................
Publisher:O'Reilly
MDA and 2nd
tagged values andPub Date: June 2005
round-trip engineeringISBN:0-596-00795-7
Pages:234
run-to-completion
RUP (Rational Unified Process)
Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

Scalable
Vector Graphics (SVG)
Table of Contents | Index
schemas 2nd
scope
diagramming
System developers have used modeling languages for decades to specify, visualize,
system boundaries
construct, and document systems. The Unified Modeling Language (UML) is one of those
use cases
languages. UML makes it possible for team members to collaborate by providing a common
select( ) operation 2nd
language that applies to a multitude of different systems. Essentially, it enables you to
selection behavior
communicate solutions in a consistent, tool-supported language.
self keyword
seq interaction operator
Today, UML has become the standard method for modeling software systems, which means
sequence diagrams
you're probably confronting this rich and expressive language more than ever before. And
communication diagrams and
even though you may not write UML diagrams yourself, you'll still need to interpret
defined
diagrams written by others.
design view and
interaction overview diagrams
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
interactions and 2nd
you who must read, create, and understand system artifacts expressed using UML.
local variables
Furthermore, it's been fully revised to cover version 2.0 of the language.
messages and
SPEM and
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
sprawling scope
types, it also explains key concepts in a way that appeals to readers already familiar with
sequence timing
UML or object-oriented programming concepts.
service component
sets, associations as
Topics include:
setup subregion
shallow history pseudostate
signal symbols
2nd and value of UML in projects
The role
signals, lifelines and
Simple Mail
Protocol (SMTP)
TheTransport
object-oriented
paradigm and its relation to the UML
simple states
An integrated approach to UML diagrams
size( ) operation
SMTP (Simple Mail Transport Protocol)
and
Object,Metamodel
Use Case,
Sequence, Collaboration, Statechart, Activity, Component,
SoftwareClass
Process
Engineering
(SPEM)
and component
Deployment Diagrams
specification
specifications
Extension
deployment
2nd 3rdMechanisms
join
The Object Constraint Language (OCL)
UML 2nd 3rd 4th
SPEM (Software Process Engineering Metamodel)
state configuration
state machine diagrams 2nd 3rd
If you're new to UML, a tutorial with realistic examples has even been included to help you
state machines
quickly familiarize yourself with the system.
behavioral 2nd
connection points
extension
protocol 2nd 3rd
representation

www.it-ebooks.info

use cases and


statechart diagrams
behavioral state machines
event processing UML 2.0 in a Nutshell

ByDan
implementation view
and Pilone,Neil Pitman
protocol state machines
2nd
...............................................
Publisher:O'Reilly
pseudostates
Pub Date: June 2005
SPEM and
ISBN:0-596-00795-7
state machine extension
Pages:234
states and
variations on 2nd
states
Table
of Contents
classifiers
and | Index
final
invariants and
System
developers
have used modeling languages for decades to specify, visualize,
OCL properties
and
construct,
overview and document systems. The Unified Modeling Language (UML) is one of those
languages.
makes
protocol stateUML
machine
and it possible for team members to collaborate by providing a common
language
that applies to a multitude of different systems. Essentially, it enables you to
pseudostates
communicate
solutions in a consistent, tool-supported language.
state invariants as
state machines and 2nd
Today,
UML has become the standard method for modeling software systems, which means
submachine
you're
probably
timing diagrams
andconfronting this rich and expressive language more than ever before. And
even
though
transitioning
2ndyou may not write UML diagrams yourself, you'll still need to interpret
diagrams
static
attributeswritten by others.
static modeling
UMLoperations
2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
static
you who must read, create, and understand system artifacts expressed using UML.
stereotypes
Furthermore,
<<realizations>>it's been fully revised to cover version 2.0 of the language.
Application Server
This
comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
component
types,
it also
explains
key concepts in a way that appeals to readers already familiar with
database
schemas
and
UML
or 2nd
object-oriented programming concepts.
defined
execution environment
Topics
include:
extending
overview
tagged values and
The role and value of UML in projects
stop symbol
stream keyword 2nd
The object-oriented paradigm and its relation to the UML
strict interaction operator
strict sequencing
An integrated approach to UML diagrams
strictfp keyword (Java)
string datatype
Class 2nd
and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
structuraland
diagrams
2nd
Deployment
Diagrams
structured classes
structures
Extension Mechanisms
classes and
defined
The Object Constraint Language (OCL)
diagramming
PIM and
subjects
If you're states
new 2nd
to UML, a tutorial with realistic examples has even been included to help you
submachine
quickly
familiarize
yourself with the system.
subroutines
subsets property (attributes)
substate machines
substates 2nd
substring( ) operation
subsystem component

www.it-ebooks.info

SVG (Scalable Vector Graphics)


swimlanes
SysML (Systems Modeling Language)
UML 2.0 in a Nutshell
SysML.org
system boundaries ByDan Pilone,Neil Pitman
Systems Modeling Language
(SysML)
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

tagged
values
Table of Contents | Index
defined
overview
stereotypes and
System developers have used modeling languages for decades to specify, visualize,
templates
construct, and document systems. The Unified Modeling Language (UML) is one of those
terminate node pseudostate
languages. UML makes it possible for team members to collaborate by providing a common
test subregion
language that applies to a multitude of different systems. Essentially, it enables you to
testing 2nd
communicate solutions in a consistent, tool-supported language.
textual representation
thrown exceptions
Today, UML has become the standard method for modeling software systems, which means
tilde (~) 2nd
you're probably confronting this rich and expressive language more than ever before. And
timing
even though you may not write UML diagrams yourself, you'll still need to interpret
sensitivity of
diagrams written by others.
sequence
timing diagrams and
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
timing diagrams
you who must read, create, and understand system artifacts expressed using UML.
defined
Furthermore, it's been fully revised to cover version 2.0 of the language.
interactions and
overview
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
tokens
types, it also explains key concepts in a way that appeals to readers already familiar with
join nodes
UML or object-oriented programming concepts.
merge nodes and
object flows and
Topics include:
overview
tools, profiles and 2nd
traces The role and value of UML in projects
transformation behaviors
transformation
functions 2nd 3rd paradigm and its relation to the UML
The object-oriented
transformation language
An integrated approach to UML diagrams
transitions
allowable time for
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
completion
and Deployment Diagrams
conflicting
data store nodes and
Extension
Mechanisms
dispatched
events and
events and
The Object Constraint Language (OCL)
internal
overview
pseudostates and
Ifrepresentation
you're new to UML, a tutorial with realistic examples has even been included to help you
state machines and 2nd 3rd
quickly
familiarize yourself with the system.
timing diagrams and
types of 2nd
trigger (transition) 2nd 3rd
type element (operations)
types

www.it-ebooks.info

artifacts
attribute syntax element
transition 2nd
UML 2.0 in a Nutshell
typing, port

ByDan Pilone,Neil Pitman


...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234

Table of Contents | Index

System developers have used modeling languages for decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

UML
(Unified Modeling Language)
Table of Contents | Index
business process modeling
common uses
designing software 2nd
System developers have used modeling languages for decades to specify, visualize,
extending
construct, and document systems. The Unified Modeling Language (UML) is one of those
rules of thumb 2nd
languages. UML makes it possible for team members to collaborate by providing a common
specifications 2nd 3rd 4th
language that applies to a multitude of different systems. Essentially, it enables you to
UML Infrastructure 2nd
communicate solutions in a consistent, tool-supported language.
UML Superstructure 2nd
underscore (_)
Today, UML has become the standard method for modeling software systems, which means
union property (attributes)
you're probably confronting this rich and expressive language more than ever before. And
unique property
even though you may not write UML diagrams yourself, you'll still need to interpret
uniqueness property 2nd
diagrams written by others.
attributes
use case diagrams
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
actors and
you who must read, create, and understand system artifacts expressed using UML.
advanced modeling
Furthermore, it's been fully revised to cover version 2.0 of the language.
components
defined
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
interfaces and
types, it also explains key concepts in a way that appeals to readers already familiar with
SPEM and
UML or object-oriented programming concepts.
use case scope
use case view and
Topics include:
use cases and 2nd
use case extension 2nd
use caseThe
generalization
role and value of UML in projects
use case inclusion
use caseThe
packages
object-oriented paradigm and its relation to the UML
use case view
An integrated approach to UML diagrams
use cases
advanced modeling
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
generalization
and2nd
Deployment Diagrams
overview
representation
scopeExtension Mechanisms
use case diagrams and

The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

value
pins
Table of Contents | Index
variables
capturing time
declaring
System developers have used modeling languages for decades to specify, visualize,
defining
construct, and document systems. The Unified Modeling Language (UML) is one of those
local
languages. UML makes it possible for team members to collaborate by providing a common
naming
language that applies to a multitude of different systems. Essentially, it enables you to
OCL and
communicate solutions in a consistent, tool-supported language.
relative times
Vector class (Java)
Today, UML has become the standard method for modeling software systems, which means
views, modeling and 2nd
you're probably confronting this rich and expressive language more than ever before. And
visibility
even though you may not write UML diagrams yourself, you'll still need to interpret
attribute syntax element 2nd
diagrams written by others.
package diagrams 2nd
visibility element (operations)

UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.

This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

wallpaper
diagrams
Table of Contents | Index
weak sequencing
weights, edges and
white-box view (components) 2nd
System developers have used modeling languages for decades to specify, visualize,
whole-part relationships 2nd 3rd

construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

www.it-ebooks.info

UML 2.0 in a Nutshell


ByDan Pilone,Neil Pitman
...............................................
Publisher:O'Reilly
Pub Date: June 2005
ISBN:0-596-00795-7
Pages:234
[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X]

Index

XML
documents 2nd
Table of Contents | Index
XML Structure Definition Language (XSDL)
xor constraint
xor logical operator 2nd
System developers have used modeling languages for decades to specify, visualize,
XSDL (XML Structure Definition Language)

construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common
language that applies to a multitude of different systems. Essentially, it enables you to
communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means
you're probably confronting this rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret
diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
you who must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts.
Topics include:
The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component,
and Deployment Diagrams
Extension Mechanisms
The Object Constraint Language (OCL)

If you're new to UML, a tutorial with realistic examples has even been included to help you
quickly familiarize yourself with the system.

Вам также может понравиться