UML Interaction Diagrams

Slides:



Advertisements
Similar presentations
Chapter 15 UML Interaction Diagrams 1CS6359 Fall 2012 John Cole.
Advertisements

Object-Oriented Analysis and Design CHAPTERS 15: UML INTERACTION DIAGRAMS 1.
Interaction Diagram Notation From Chapter 15 of Craig Larman, Applying UML and Patterns John Dalesandro.
Jan 15, Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Iteration: a simple cash-only success scenario of Process Sale.
Sept Ron McFadyen Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together.
Sequence Diagram Objects are represented horizontally across the top of the diagram The first object is typically an Actor, the one who initiates Each.
Sequence Diagram Objects are represented horizontally across the top of the diagram Each object has a lifeline some exist before and/or after some are.
Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together to achieve some functionality.
Lecture 5 …a bit more about UML Sequence diagrams Collaboration diagrams State-chart diagrams CRC cards.
Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects show the flow of control across many objects used to.
Jan Ron McFadyen1 Consider a simple cash-only Process Sale scenario 1. Customer arrives at a POS checkout with goods and/or services to purchase.
Sept Ron McFadyen Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together.
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
Sept Ron McFadyen Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together.
Dynamic modeling using UML
Lab 6 CPIT 250 System Analysis and Design.
Sept Ron McFadyen1 Extend Relationship.
SE-565 Software System Requirements More UML Diagrams.
Designing with Interaction and Design Class Diagrams Chapters 15 & 16 Applying UML and Patterns Craig Larman With some ideas from students in George Blank’s.
SENG 403 SENG 403 – Winter  Brief introduction to SSD  Example (A sales systems (Cashier))  Example (Monopoly game) SENG 403 – Winter 2012.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
INFO 620Lecture #51 Information Systems Analysis and Design Sequence and Collaboration Diagrams INFO 620 Glenn Booker.
UML Collaboration Diagram. Recap System Sequence Diagrams (SSD) UML for SSD Examples.
Interaction diagrams Sequence and collaboration diagrams.
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
Introduction to Interaction Diagrams Used to illustrate the dynamic behaviour of a community of objects that collaborate by passing messages in order to.
1 On to Object Design Chapter 14 Applying UML and Patterns.
1 Sequence Diagrams (Based on Stevens and Pooley (2006, Chapters 9, 10) and Fowler (2004, Chapter 4)) David Meredith Aalborg University.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 UML Sequence Diagrams.
BTS430 Systems Analysis and Design using UML Interaction Diagrams.
Copyright © Hsiao-Lan Wei All Rights Reserved Design Model Interaction diagram.
Starting Object Design
Chapter 4: UML Interaction Diagrams. Objective Provide a reference for frequently used UML interaction diagram notation- sequence and communication diagrams.
Engineering 5895: Software Design 10/5/01Interaction Diagrams1 Modeling Behaviour Engineering 5895: Software Design.
Collaboration Diagrams CSIS3600. What is a Collaboration Diagram Collaboration diagrams illustrate interactions between objects The collaboration diagram.
Sequence diagram in UML Martin Palkovik. Sequence diagram  It is a graphic representation of system operations based on chronology - a time sequence.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Interaction Diagram Notation
Object-Oriented Analysis and Design Feb 11, 2009.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour UML Sequence Diagram.
CSCI-383 Object-Oriented Programming & Design Lecture 12.
Collaboration diagrams. Purpose A collaboration diagram is an alternate way to show a scenario. A collaboration diagram shows the objects and relationships.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
Use-Case Model: Adding Detail with Operation Contracts.
 The Sequence Diagram models the collaboration of objects based on a time sequence.  It shows how the objects interact with others in a particular scenario.
1 Kyung Hee University Interaction Diagrams Spring 2001.
1 Object Oriented Analysis System modeling = Functional modeling + Object modeling + Dynamic modeling Functional modeling = Use cases Object modeling =class.
Project 2: Phase 1 Submission 7 Late submissions 10% 10 No submissions 14% Better than project 1 phase 3 submissions 10-point bonus: If you catch the deadline.
Design Model: Determining Visibility CH-18. Objectives Identify four kinds of visibility. Design to establish visibility. Illustrate kinds of visibility.
Collaboration Diagrams
UML Interaction Diagrams
Chapter 11: Collaboration Diagram - PART1
Sequence Diagram.
Communication DIAGRAM
Sequence Diagrams.
Interactions.
UML Sequence Diagrams.
Requirements To Design In This Iteration
Princess Nourah bint Abdulrahman University
System Sequence Diagrams
Communication Diagrams
Interaction diagrams.
Unified Modelling Language
Chapter 9: Sequence Diagrams Chapter 5 in Software Engineering Book
Interaction Diagrams A Lot of UML!
Interaction diagrams Interaction diagrams are models that describe how groups of objects collaborate in some behavior. Typically, an interaction diagram.
Communication DIAGRAM
CONTENTS Object-Oriented Modeling Using UML
Chapter 9: Sequence Diagrams Chapter 5 in Software Engineering Book
Presentation transcript:

UML Interaction Diagrams Ch. 15

Interaction Diagram Notation

Introduction Interaction diagrams illustrate how objects interact via messages. Collaboration diagrams illustrate object interactions in a graph or network format. message1( ) :ClassAInstance 1: message2() 2: message3() :ClassBInstance

Sequence vs Collaboration Diagrams :ClassAInstance :ClassBInstance message1( ) :ClassAInstance message1() message2() 1: message2() 2: message3() What is the difference of collaboration vs sequence diagrams? For which components of a sw project do we draw a sequence diagram? For which components of a sw project do we draw a collaboration diagram? Collab: more for whiteboard vertical/horizontal expansion Spend time doing dynamic modeling! message3() :ClassBInstance

Example Collaboration Diagram: makePayment direction of message first internal message makePayment(cash Tendered) :Register 1: makePayment(cash Tendered) :Sale parameter link line 1.1: create(cash Tendered) first message instance :Payment object creation

How to Read the makePayment Collaboration Diagram The message makePayment is sent to an instance of Register. The sender is not identified. The Register instance sends the makePayment message to a Sale instance. The Sale instance creates an instance of a Payment. makePayment(cashTendered) :Register 1: makePayment(cashTendered) :Sale 1.1: create(cashTendered) :Payment

Example Sequence Diagram: makePayment :Register :Sale makePayment (cashTendered) makePayment (cashTendered) create (cashTendered) :Payment

Illustrating Classes and Instances To show an instance of a class, the regular class box graphic symbol is used, but the name is underlined. Additionally a class name should be preceded by a colon. An instance name can be used to uniquely identify the instance. Sale Class :Sale Instance s1:Sale Named instance

Messages to “self” or “this” A message can be sent from an object to itself. This is illustrated by a link to itself, with messages flowing along the link. msg1() :Register 1: clear()

Creation of Instances The language independent creation message is create, being sent to the instance being created. The create message may include parameters, indicating passing of initial values. msg1 ( ) 1: create (cashier) :Register :Sale newly created instance

Creation of Instances An object lifeline shows the extend of the life of an object in the diagram. Note that newly created objects are placed at their creation height. :Register :Sale makePayment(…) makePayment(…) create(…) :Payment

Lifelines Synchronous vs asynchronous messages

Asynchronous vs synchronous calls Async: not block or wait for response, used in multithreaded java

Return Values

Conditional Messages :A :B message1() [color=red] calculate()

Conditionals

Conditional Messages A conditional message is shown by following a sequence number with a conditional clause in square brackets, similar to the iteration clause. The message is sent only if the clause evaluates to true. msg1 ( ) 1: [new sale] create (cashier) :Register :Sale Link: connection path between two objects (straight line in comm diag.)

Mutually Exclusive Conditional Paths 1a and 1b are mutually exclusive conditional paths. Both are sequence number 1 since either could be the first internal message. unconditional after either msg2() or msg4() :ClassE 2: msg6() msg1 ( ) 1a: [test1] msg2() :ClassA :ClassB 1b: [not test1] msg4() 1a.1: msg3() :ClassD :ClassC 1b.1: msg5()

Iteration or Looping Iteration; Recurrence values omitted Iteration is indicated by following the sequence number with a star * This expresses that the message is being sent repeatedly, in a loop, to the receiver. It is also possible to include an iteration clause indicating the recurrence values. msg1( ) 1*: li := nextLineItem(): SalesLineItem :Register :Sale Iteration clause msg1( ) 1*: [i :=1..10] li := nextLineItem(): SalesLineItem :Register :Sale