Communication Diagrams

Similar documents
Sequence Diagrams. Massimo Felici. Massimo Felici Sequence Diagrams c

Announcements. SE 1: Software Requirements Specification and Analysis. Review: Use Case Descriptions

Object Oriented Programming. Risk Management

Using UML Part Two Behavioral Modeling Diagrams

Use Cases. Massimo Felici. Massimo Felici Use Cases c

Object Oriented Design

Tutorial - Building a Use Case Diagram

Sequence Diagram Tutorial. From: UML Distilled, Third Edition, Chapter 4 M. Fowler

Case studies: Outline. Requirement Engineering. Case Study: Automated Banking System. UML and Case Studies ITNP090 - Object Oriented Software Design

TDDC88 Lab 2 Unified Modeling Language (UML)

UML TUTORIALS THE USE CASE MODEL

Introduction. UML = Unified Modeling Language It is a standardized visual modeling language.

Masters of Science in Software & Information Systems

Interaction Diagrams. Use Cases and Actors INTERACTION MODELING

Questions? Assignment. Techniques for Gathering Requirements. Gathering and Analysing Requirements

UML Diagram Types. Use Cases do the Following. Use Case Diagram

[1] [2]

Umbrello UML Modeller Handbook

Phases, Activities, and Work Products. Object-Oriented Software Development. Project Management. Requirements Gathering

StarUML Documentation

Object-Oriented Design Guidelines

In this Lecture you will Learn: Systems Development Methodologies. Why Methodology? Why Methodology?

Business Modeling with UML

Chap 1. Introduction to Software Architecture

The «include» and «extend» Relationships in Use Case Models

UML for C# Modeling Basics

Appendix... B. The Object Constraint

Applying 4+1 View Architecture with UML 2. White Paper

11 November

Using UML Part One Structural Modeling Diagrams

Algorithm & Flowchart & Pseudo code. Staff Incharge: S.Sasirekha

(BA122) Software Engineer s Workshop (SEW)

Writing Use Case Scenarios for Model Driven Development

Object-oriented design methodologies

Chapter 4 Software Lifecycle and Performance Analysis

Model Simulation in Rational Software Architect: Business Process Simulation

Using Rational Rose to Create Object-Oriented Diagrams

4. Multiagent Sys stems Design. Part 2: The PROMETHEUS methodology.

2. Analysis, Design and Implementation

Compliance and Requirement Traceability for SysML v.1.0a

COSC 3351 Software Design. Recap for the first quiz. Edgar Gabriel. Spring For the 1 st Quiz

Use Cases. Reference: Craig Larman, Applying UML and Patterns, Ch. 6

Scenario-based Requirements Engineering and User-Interface Design

Aerospace Software Engineering

Database Design Overview. Conceptual Design ER Model. Entities and Entity Sets. Entity Set Representation. Keys

Requirements engineering

How to contribute to the joint course on software engineering by case studies

The Role of the Software Architect

Incorporating Aspects into the UML

Software Development in the Large!

UML basics. Part II: The activity diagram. The activity diagram's purpose. by Donald Bell IBM Global Services

Architecture Design & Sequence Diagram. Week 7

User experience storyboards: Building better UIs with RUP, UML, and use cases

UML Modelling of Automated Business Processes with a Mapping to BPEL4WS

Unit 2.1. Data Analysis 1 - V Data Analysis 1. Dr Gordon Russell, Napier University

Types of UML Diagram. UML Diagrams OOAD. Computer Engineering Sem -IV

Modeling Guidelines Manual

Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page:

Real Time Programming: Concepts

Two Roles of Processes in SOA

Software Development Methodologies

Automated Modeling of Legacy Systems Using the UML

Software Requirements 1

BCS THE CHARTERED INSTITUTE FOR IT. BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT SYSTEMS ANALYSIS & DESIGN EXAMINERS REPORT

How To Create A Complex Diagram On A Computer Game

Overview. System Definition Webster s Dictionary. System Engineering Hierarchy. System Engineering. Computer-Based Systems [PRE2005]

Classical Software Life Cycle Models

MODELING OF SERVICE ORIENTED ARCHITECTURE: FROM BUSINESS PROCESS TO SERVICE REALISATION

Business-Driven Software Engineering Lecture 3 Foundations of Processes

(Refer Slide Time 00:56)

Software Engineering. System Models. Based on Software Engineering, 7 th Edition by Ian Sommerville

CDC UNIFIED PROCESS PRACTICES GUIDE

A Comparison of Service-oriented, Resource-oriented, and Object-oriented Architecture Styles

Software Architecture

KWIC Exercise. 6/18/ , Spencer Rugaber 1

Managing Variability in Software Architectures 1 Felix Bachmann*

Software Specification and Architecture 2IW80

Designing Real-Time and Embedded Systems with the COMET/UML method

Outlook . User Guide IS TRAINING CENTER. 833 Chestnut St, Suite 600. Philadelphia, PA

INFS 2603 BUSINESS SYSTEMS ANALYSIS

High-level Design. What is software architecture?

Using Use Cases for requirements capture. Pete McBreen McBreen.Consulting

Course Code and Name Year - Semester. Number of marks

A Template for Documenting Software and Firmware Architectures

Object Oriented Software Models

2. Basic Relational Data Model

Chapter 4, Requirements Elicitation

A UML Introduction Tutorial

Lecture Slides for Managing and Leading Software Projects. Chapter 5: Project Planning Techniques

The Software Process. The Unified Process (Cont.) The Unified Process (Cont.)

UML TUTORIALS THE COMPONENT MODEL

Lab Manual: Using Rational Rose

Chapter 2: Entity-Relationship Model. Entity Sets. " Example: specific person, company, event, plant

: provid.ir

Performing Early Feasibility Studies of Software Development Projects Using Business Process Models

CSE4213 Lecture Notes

Use-Case Analysis. ! What is it? ! From where did it come? ! Now part of UML

i. Node Y Represented by a block or part. SysML::Block,

Execution of A Requirement Model in Software Development

Case Study Solutions. This appendix contains the solutions to the Acme Mining Company Case Study.

Transcription:

Communication Diagrams Massimo Felici

Realizing Use cases in the Design Model 1

Slide 1: Realizing Use cases in the Design Model Use-case driven design is a key theme in a variety of software processes based on the UML UML supports specific modelling constructs that realize use cases in the implementation Collaborations (Communications) enhance the systematic and aggregate behavioural aspects of the system Collaborations support traceability from requirements expressed in use cases into the design

Rationale 2 Communication Diagrams Model collaborations between objects or roles that deliver the functionalities of use cases and operations Model mechanisms within the architectural design of the system Capture interactions that show the passed messages between objects and roles within the collaboration Model alternative scenarios within use cases or operations that involve the collaboration of different objects and interactions Support the identification of objects (hence classes) that participate in use cases

Communication Diagrams 3 The communication is implicit in a Sequence Diagram, rather than explicitly represented as in a Communication Diagram There is some redundancy between Communication and Sequence Diagrams They differently show how elements interact over time They document in detail how classes realize user cases Communication Diagrams show relationship between objects Sequence Diagrams focus on the time in which events occur

Slide 3: Communication Diagrams Communication Diagrams, formerly called Collaboration Diagrams. UML Interaction Diagrams refine the kind of activity undertaken in checking with CRC cards.

Example 4 Sequence and Communication Diagrams

What is a Collaboration? 5 Communication Diagrams A Collaboration is a collection of named objects and actors with links connecting them A Collaboration defines a set of participants and relationships that are meaningful for a given set of purposes A Collaboration between objects working together provides emergent desirable functionalities in Object-Oriented systems Objects collaborate by communicating (passing messages) with one another in order to work together

Slide 5: Communication Diagrams Objects and actors collaborate in performing some task. (responsibility) partially supports emergent functionalities. Each object Objects are able to produce (usable) high-level functionalities by working together.

Collaborations 6 Actors Each Actor is named and has a role One actor will be the initiator of the use case Objects Each object in the collaboration is named and has its class specified Not all classes need to appear There may be more than one object of a class Links Links connect objects and actors and are instances of associations Each link corresponds to an association in the class diagram

Interactions 7 Use Cases and Class Diagrams constrain interactions Associations and Links in a Collaboration Diagram show the paths along which messages can be sent from one instance to another A message is the specification of a stimulus A stimulus represents a specific instance of sending the message, with particular arguments

Specification and Instance Levels 8 Communication Diagrams Specification level shows generic cases of collaborations (communications) Generic form captures a collaboration among class roles and association roles and their interactions Instance level shows a specific instance of an interaction taking place and involving specific object instances Instance form captures a scenario among objects conforming to class roles and links conforming to association roles

Lifelines and Links 9 Participants on a collaboration diagram are represented by a rectangle The syntax for the name of a lifeline [connectable-element-name][ [ selector ] ][:class-name][decomposition] A communication link is shown with a single line that connects two participants

Slide 9: Lifelines and Links In UML 2.0 lifeline names are no longer underlined. UML 2.0 introduces rectangular frames around communication diagrams.

Simple Example 10 Communication Diagrams

Messages 11 A message on a communication diagram is shown using an arrow from the message sender to the message receiver Message Signature: return-value, message-name, argument-list Each message in a collaboration diagram has a sequence number. The top-level message is numbered 1. Messages sent during the same call have the same decimal prefix but suffixes of 1, 2, etc. according to when they occur.

Messages 12 Synchronous Asynchronous Creation Reply

Messages 13 Procedural or Synchronous: A message is sent by one object to another and the first object waits until the resulting action has completed. Asynchronous: A message is sent by one object to another, but the first object does not wait until the resulting action has completed. Flat: Each arrow shows a progression from one step to the next in a sequence. Normally the message is asynchronous. Return: the explicit return of control from the object to which the message was sent.

Messages 14 Messages occurring at the same time: Adding a number-and-letter notation to indicate that a message happens at the same time as another message Invoking a message multiple times: Looping constraint, e.g., *[i=0..9] Sending a message based on a condition: A guardian condition is made up of a logical boolean statement, e.g., [condition=true] When a participant sends a message to itself

Where should messages go? 15 Messages The message is directed from sender to receiver The receiver must understand the message The association must be navigable in that direction Law of Demeter Dealing with a message m an Object O can send messages to: Itself Objects sent as argument in the message m Objects O creates in responding to m Objects that are directly accessible from O, using attribute values

Slide 15: Messages Suggested Readings K.J. Lieberherr, I.M. Holland. Assuring good style for object-oriented programs. IEEE Software 6(5):38-48, 1989.

Activations 16 Flow of Control Procedural interactions At most one object is computing at any time Activation An object has a live activation from when it receives a message until it responds to the message Waiting for response Synchronous messages on sending a message to another object, an object will wait until it receives a response Activation task Activations are stacked and the top activation has control. When the top action responds the next to top regains control and so on...

Creation and Deletion 17 In Sequence Diagrams, It is possible to use the lifelines New objects have their icon inserted when they are created Destroyed objects have their lifeline terminated with In Communication Diagrams the objects are labelled: New for objects created in the collaboration Destroyed for objects destroyed during the collaboration

Slide 17: Example 1: n := getname() :UTO 3:destroy() :Lecturer {destroyed} 2: new DirectorOfStudies (n) :DirectorOfStudies {new} :Lecturer :UTO 1: n := getname() 2: new DirectorOfStudies (n) :DirectorOfStudies 3:destroy()

Communication vs. Sequence Diagrams Communication Diagrams 18 Sequence Diagrams Participants!! Links! Message Signature!! Parallel Messages!! Asynchronous messages! Message Ordering! Create & Maintain!

Slide 18: Communication vs. Sequence Diagrams Shows participants effectively: Both Communication and Sequence diagrams show participants effectively Showing the links between participants: Communication diagrams explicitly and clearly show the links between participants Showing message signatures: Both Communication and Sequence diagrams show messages effectively Support parallel messages: Both Communication and Sequence diagrams show parallel messages effectively Support asynchronous messages: Sequence diagrams explicitly and clearly show the links between participants Easy to read message ordering: Sequence diagrams explicitly and clearly show message ordering Easy to create and maintain: Communication diagrams do have the edge on the ease-of-maintenance

Constructing Communication Diagrams 1. Identify behaviour 2. Identify the structural elements 3. Model structural relationships 4. Consider the alternative scenarios 19

Slide 19: Constructing Communication Diagrams 1. Identify behaviour whose realization and implementation is specified 2. Identify the structural elements (class roles, objects, subsystems) necessary to carry out the functionality of the collaboration; Decide on the context of interaction: system, subsystem, use case and operation 3. Model structural relationships between those elements to produce a diagram showing the context of the interaction 4. Consider the alternative scenarios that may be required; Draw instance level collaboration diagrams, if required; Optionally, draw a specification level collaboration diagram to summarise the alternative scenarios in the instance level sequence diagrams

Readings 20 Required Readings UML course textbook, Chapter 10 on More on Interaction Diagrams Suggested Readings K.J. Lieberherr, I.M. Holland. Assuring good style for object-oriented programs. IEEE Software 6(5):38-48, 1989.

Summary 21 Interaction Diagrams Sequence Diagrams Communication Diagrams Communication Diagrams Rationale Communication Diagrams Collaborations Interactions Messages Constructing Communication Diagrams