like UML sequence diagrams, are used to explore the dynamic nature of your software.
Collaboration diagrams show the message flow between objects
in an OO application, and also imply the basic associations (relationships)
between classes. Collaboration
diagrams are often used to:
a birds-eye view of a collection of collaborating objects, particularly
within a real-time environment.
functionality to classes by exploring the behavioral aspects of a system.
the logic of the implementation of a complex operation, particularly one
that interacts with a large number of other objects.
the roles that objects take within a system, as well as the different
relationships they are involved with when in those roles.
There are guidelines for:
Figure 1. An Instance-Level UML
- Use Instance-Level Diagrams To Explore Object Design Issues. Instance-level UML Collaboration diagrams, such as the one
1 , depict interactions between objects (instances).
Instance-level diagrams are typically created to explore the internal
design of object-oriented software.
- Use Specification-Level Diagrams to Explore Roles. Specification-level UML Collaboration diagrams, such as the
one shown in
Figure 4 , are used to analyze and explore the roles taken by domain classes
within a system.
- Collaboration Diagrams Do Not Model Process Flow.
- When Sequence Is Important Use a Sequence Diagram.
- Apply Sequence Diagram Guidelines To Instance-Level Collaboration
Diagrams. Because UML Collaboration diagrams depict an alternate view
of the same information as UML Sequence diagrams much of the same style advice
applies. The following lists of
guidelines, originally presented for UML Sequence diagrams, are applicable to
Objects When Your Reference Them In Messages
Objects When Several of the Same Type Exist
Textual Stereotypes Consistently
Visual Stereotypes Sparingly
on Critical Interactions
Names Over Types for Parameters
Types as Parameter Placeholders
Not Model a Return Value When it is Obvious What is Being Returned
a Return Value Only When You Need to Refer to it Elsewhere
Return Values as Part of a Method Invocation
Types as Return Value Placeholders
presents the notation for invoking messages on UML Collaboration
diagrams. For example in Figure
the message 1.2:
orderTotal := calculateTotal() indicates
a sequence number of 1.2, there is no loop occuring, a return value of orderTotal
and an invoked method named calculateTotal().
The basic notation for invoking a message on a collaboration diagram.
|sequenceNumber loopIndicator: returnValue :=
. A UML Collaboration diagram depicting concurrent message invocations.
- Indicate a Return Value Only When It Isn’t Clear
- Indicate Parameters Only When They Aren’t Clear
- Depict an Arrow For Each Message
- Consolidate Getter Invocations. When you have several getters invoked in a row a good short cut is to
model a single message such as
1 to act as a placeholder.
- Indicate Concurrent Threads With Letters
Figure 3 you see that some messages are preceded by the letters
D indicating that
those messages are being processed concurrently.
The lines between the classifiers depicted on a UML
Collaboration diagram represent instances of the relationships – including
associations, aggregations, compositions, and dependencies – between
Figure 4. A Specification-Level
UML Collaboration diagram.
- Model “Bare” Links On Instance-Level Collaboration Diagrams
- Show Role-Pertinent Information on Specification-Level Diagrams. In
Figure 4 you see that the roles taken by classes as well as the high-level
multiplicities (either blank or an asterisk to represent many) are depicted.
- Prefer Roles on Links Instead of Within Classes
- Indicate Navigability Sparingly
- Links Should Be Consistent Static Relationships
The Elements of UML 2.0 Style describes a collection
of standards, conventions, and
for creating effective
UML diagrams. They are based on sound, proven
software engineering principles that lead to diagrams
that are easier to understand and work with. These
conventions exist as a collection of simple, concise
guidelines that if applied consistently, represent an
important first step in increasing your productivity as
a modeler. This book is oriented towards
intermediate to advanced UML modelers, although there
are numerous examples throughout the book it would not
be a good way to learn the UML (instead, consider
The Object Primer). The book is a brief 188
pages long and is conveniently pocket-sized so it's easy
to carry around.
The Object Primer 3rd Edition: Agile Model Driven
Development with UML 2 is an
important reference book for agile modelers,
describing how to develop 35
types of agile
models including all 13
UML 2 diagrams.
Furthermore, this book describes the techniques
Full Lifecycle Object Oriented Testing
(FLOOT) methodology to give you the fundamental
testing skills which you require to succeed at
agile software development. The book also
shows how to move from your agile models to
source code (Java examples are provided) as well
as how to succeed at implementation techniques
(TDD). The Object Primer also includes a
chapter overviewing the critical database
development techniques (database refactoring,
legacy analysis, and
database access coding) from my award-winning
Agile Database Techniques
Agile Modeling: Effective Practices for Extreme
Programming and the Unified Process is the seminal
book describing how agile software developers approach
documentation. It describes principles and
practices which you can tailor into your existing
software process, such as
Rational Unified Process (RUP), or the
Agile Unified Process (AUP), to streamline your
modeling and documentation efforts. Modeling and
documentation are important aspects of any software
project, including agile projects, and this book
describes in detail how to
architect, and then
design your system in an agile manner.
We actively work with clients around the world to
improve their information technology (IT) practices,
typically in the role of mentor/coach, team lead, or trainer. A full
description of what we do, and how to contact us, can be
found at Scott W.
Ambler + Associates.