Sequence and Collaboration Diagrams - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Sequence and Collaboration Diagrams

Description:

These are (usually) drawn across the top of the diagram. ... These (usually) extend down the diagram. ... Arrows are the same as those used in sequence diagrams. ... – PowerPoint PPT presentation

Number of Views:90
Avg rating:3.0/5.0
Slides: 16
Provided by: harry66
Category:

less

Transcript and Presenter's Notes

Title: Sequence and Collaboration Diagrams


1
Sequence and Collaboration Diagrams
  • University of Sunderland

2
Purpose
  • Used to describe how subsystems and objects
    interact to produce the behavior of the system.
  • Provide complementary representations of the same
    information. You can convert from sequence
    diagrams to collaboration diagrams by considering
    the association roles.
  • Collaboration diagrams are the starting point for
    generating the object and class diagrams.
  • Collaboration diagrams are renamed communication
    diagrams in UML 2.

3
Recommended Texts
  • Key text Stevens and Pooley, 2000, Using UML,
    updated edition, Addison-Wesley, ISBN
    0-201-64860-1.
  • Reference text Alhir, 1998, UML in a Nutshell,
    OReilly, ISBN 1-56592-448-7. (The basis for
    much of these lectures.)
  • Advanced text Graham, 2001, Object-Oriented
    Methods, 3rd edition, Addison-Wesley, ISBN
    0-201-61913-X.
  • Several articles are providedexplore them
    thoroughly in tutorial and at home!

4
Sequence Diagram Notation
  • Sequence diagrams contain the following
  • Class roles (subsystem/object/class, actor, and
    external system roles in the interaction). These
    are (usually) drawn across the top of the
    diagram.
  • Lifelines (subsystem/object/class existence).
    These (usually) extend down the diagram.
  • Activations (show when the subsystem/object/class
    is doing something)
  • Messages (communication between roles)

5
Technique for Construction
  • Specify behavior
  • List class roles
  • Draw lifelines
  • Identify activations
  • Identify messages
  • Iterate

6
Sample Sequence Diagram
Role1
Role4
Role3
Role2
Class Role
Activation
Message
Lifeline
Recursive Activation
7
Class Roles
  • Notation is a rectangle containing
    RoleNameClassName (both underlined)
  • Can be an interface instead of class.
  • May have a number in the upper right hand corner
    giving the number of instances involved.
  • Represents an object, class, actor (person),
    subsystem or external system.

8
Lifelines
  • Dashed or dotted line from past to future or from
    birth to death if a role with a limited lifespan.
  • Death is marked with a large
  • May split and merge to represent alternative
    paths. E.g.,

9
Activation
  • Shown by a box over a lifeline
  • Represents an active role
  • May call itself recursively

10
Messages
  • Denoted by labeled horizontal arrows
  • If simply an arrow, represents flow of control.
  • If shown as
  • represents a handshake (e.g., TCP).
  • If with a half-arrowhead, asynchronous (e.g.,
    UDP)
  • If at an angle rather than horizontal, represents
    a time delay

paired
11
Collaboration Diagram Notation
  • Forms a context for interactions
  • May realize use cases
  • May be associated with operations
  • May describe the static structure of classes
  • Collaboration diagrams contain the following
  • Class roles (subsystems/objects/classes/actors/
    external systems) as before.
  • Association roles (pathways or links over which
    messages flow)
  • Message flows (messages sent between class roles)

12
Technique for Construction
  • Specify behavior.
  • List class roles.
  • Identify association roles.
  • Define message flows
  • Iterate

13
Sample Collaboration Diagram
A Class Role
An Anonymous Role
RoleName ClassName
ClassName
A Message
An Association Role
ClassName
14
Association Roles
  • Often classes
  • Define the interaction between class roles.
  • Multiplicities defined if the Class Roles
    represent sets of objects

Role-NameAssociation-Name
Multiplicity
Multiplicity
15
Message Flows
  • Sequence numbers on every message. These can be
    nested to associate related messages.
  • Arrows are the same as those used in sequence
    diagrams.
Write a Comment
User Comments (0)
About PowerShow.com