Sequence Diagrams By Zvika Gutterman Adam Carmi. Sequence Diagrams2 Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control.

Slides:



Advertisements
Similar presentations
SEQUENCE DIAGRAM. UML diagrams There are many ways of organizing the UML diagrams. Can be organized as the fallowing: 1. Structural diagrams: to show.
Advertisements

Concepts & Notations. Acknowledgements  The material in this tutorial is based in part on: The Unified Modeling Language Reference Manual, 2 nd edition,
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.
System Sequence Diagrams (SSD). Recap Concepts of Action, Pins and Activity Description of activity nodes and activity edges New notations – Activity.
Interaction Diagrams Software Engineering BIT8. Interaction Diagrams  A series of diagrams describing the dynamic behavior of an object-oriented system.
THE OBJECT-ORIENTED DESIGN WORKFLOW UML2 Sequence Diagrams.
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
L26-S1 Interactions 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I.
Unified Modeling Language (UML)
Sequence Diagrams By Zvika Gutterman Adam Carmi. Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control Information Examples.
Dynamic modeling using UML
Sequence Diagram. What is Sequence Diagram?  Sequence Diagram is a dynamic model of a use case, showing the interaction among classes during a specified.
Modern Systems Analysis and Design Fifth Edition Jeffrey A
Sequence Diagrams By Zvika Gutterman Adam Carmi. Sequence Diagrams2 Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control.
SE-565 Software System Requirements More UML Diagrams.
1 Lab Beginning Analysis and Design 4 Completion of first version of use case diagram initiates the processes of analysis and design. 4 UML provides.
Slide 1 Use Case Sequence Diagram. Slide 2 Interaction Diagrams l Interaction diagrams model the behavior of use cases by describing the way groups of.
SEQUENCE DIAGRAM Prepared by: T. Fatimah Alageel.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface.
CS3773 Software Engineering
UML Collaboration Diagram. Recap System Sequence Diagrams (SSD) UML for SSD Examples.
Interactions. 2 Objects communicate with each other by sending messages. Sending a message is another name for a member function call. –Some C++ examples.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Interaction diagrams Sequence and collaboration diagrams.
The Vision SSM Models Databases Use Cases Programs Activity Models
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 25. Review Design Level Class Diagram Identifying classes/Operations/Attributes Associations – Simple associations.
Dynamic Modeling Chapter 11 Part of Analysis Modeling Designing Concurrent, Distributed, and Real-Time Applications with UML Hassan Gomaa (2001)
1 Sequence Diagrams (Based on Stevens and Pooley (2006, Chapters 9, 10) and Fowler (2004, Chapter 4)) David Meredith Aalborg University.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 9: Interaction.
1 Modeling interactions and behavior Lecturer Dr. Mai Fadel.
Starting Object Design
Collaboration Diagrams CSIS3600. What is a Collaboration Diagram Collaboration diagrams illustrate interactions between objects The collaboration diagram.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Interaction and Communication Diagrams Patrick Bailey Keith Vander Linden Calvin College.
M Taimoor Khan Sequence Diagrams Illustrates how objects interacts with each other. Emphasizes time ordering of messages.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Information Systems Engineering Interaction Diagrams: Sequence Diagram Collbortion Diagram.
Interaction Diagrams Interaction Diagrams allow the designer to show how groups of objects collaborate in some behavior. –Interaction Diagrams will show.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour UML Sequence Diagram.
Object-Oriented Analysis and Design 1 Mira Balaban & Arnon Sturm Object-Oriented Analysis and Design Session 3a: Behavioral Modeling - Interactions.
Object Oriented Analysis and Design Sequence Diagrams.
System sequence diagram M Taimoor Khan
UNIFIED MODELING LANGUAGE(UML) BY Touseef Tahir Lecturer CS COMSATS Institute of Information Technology, Lahore.
CSCI-383 Object-Oriented Programming & Design Lecture 12.
7. 2Object-Oriented Analysis and Design with the Unified Process Objectives  Detailed Object-Oriented Requirements Definitions  System Processes—A Use.
1 START AT 31 MARCH END 8 APRIL PHASE5(CONCEPTUAL AND SEQUENCE MODEL)
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
(14-2) UML Instructor - Andrew O’Fallon CptS 122 (December 2, 2015) Washington State University.
Chapter 3: Introducing the UML
UML Class Diagrams Sequence Diagrams CSE230 Dae-Kyoo Kim.
 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 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
ITEC1301 Object-Oriented Systems Construction Lecture Notes #4 1.
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.
Sequence diagrams Lecture 5. Main terms  Interaction  Life line  Activation  Executable behavior and derived behavior  Messages  Trajectory  Frame.
Interactions.
Sequence Diagrams Mimi Opkins CECS 493 Fall2016
Chapter 11: Collaboration Diagram - PART1
Sequence Diagram.
Object Oriented Analysis and Design
Requirements To Design In This Iteration
Princess Nourah bint Abdulrahman University
Sequence Diagrams.
IMAT5205 Systems Analysis and Design
Interaction diagrams.
Unified Modelling Language
Interaction diagrams Interaction diagrams are models that describe how groups of objects collaborate in some behavior. Typically, an interaction diagram.
Sequence Diagrams.
Chapter 4 Sequence Diagrams
Presentation transcript:

Sequence Diagrams By Zvika Gutterman Adam Carmi

Sequence Diagrams2 Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control Information Examples

Sequence Diagrams3 Interaction Diagrams A series of diagrams describing the dynamic behavior of an object-oriented system. –A set of messages exchanged among a set of objects within a context to accomplish a purpose. Often used to model the way a use case is realized through a sequence of messages between objects.

Sequence Diagrams4 Interaction Diagrams (Cont.) The purpose of Interaction diagrams is to: –Model interactions between objects –Assist in understanding how a system (a use case) actually works –Verify that a use case description can be supported by the existing classes –Identify responsibilities/operations and assign them to classes

Sequence Diagrams5 Interaction Diagrams (Cont.) UML –Collaboration Diagrams Emphasizes structural relations between objects –Sequence Diagram The subject of this tutorial

Sequence Diagrams6 A First Look at Sequence Diagrams Illustrates how objects interacts with each other. Emphasizes time ordering of messages. Can model simple sequential flow, branching, iteration, recursion and concurrency.

Sequence Diagrams7 A Sequence Diagram member: LibraryMember book:Book :Book Copy borrow(book) ok = mayBorrow() [ok] borrow(member) setTaken(member)

Sequence Diagrams8 A Sequence Diagram member: LibraryMember book:Book :Book Copy borrow(book) ok = mayBorrow() [ok] borrow(member) setTaken(member) X-Axis (objects) Y-Axis (time) Object Life Line message Activation box condition

Sequence Diagrams9 Object Object naming: –syntax: [instanceName][:className] –Name classes consistently with your class diagram (same classes). –Include instance names when objects are referred to in messages or when several objects of the same type exist in the diagram. The Life-Line represents the object’s life during the interaction myBirthdy :Date

Sequence Diagrams10 Messages An interaction between two objects is performed as a message sent from one object to another. –Most often implemented by a simple operation call. –Can be an actual message sent through some communication mechanism, either over the network or internally on a computer. Inter-process communication (Signaling, …) Remote Procedure Call (RMI, CORBA, …)

Sequence Diagrams11 Messages (Cont.) If object obj 1 sends a message to another object obj 2 some link must exist between those two objects: –Structural dependency –obj 2 is in the global scope of obj 1 –obj 2 is in the local scope of obj 1 (method argument) –obj 1 and obj 2 are the same object

Sequence Diagrams12 Messages (Cont.) A message is represented by an arrow between the life lines of two objects. –Self calls are also allowed –The time required by the receiver object to process the message is denoted by an activation-box. A message is labeled at minimum with the message name. –Arguments and control information (conditions, iteration) may be included. –Prefer using a brief textual description whenever an actor is the source or the target of a message.

Sequence Diagrams13 Message Types Synchronous Asynchronous Simple Create Destroy >

Sequence Diagrams14 Synchronous Messages Nested flow of control, typically implemented as an operation call. –The routine that handles the message is completed before the caller resumes execution. :A:B doYouUnderstand() Caller Blocked return (optional) yes

Sequence Diagrams15 Return Values Optionally indicated using a dashed arrow with a label indicating the return value. –Don’t model a return value when it is obvious what is being returned, e.g. getTotal() –Model a return value only when you need to refer to it elsewhere, e.g. as a parameter passed in another message. –Prefer modeling return values as part of a method invocation, e.g. ok = isValid()

Sequence Diagrams16 Object Creation An object may create another object via a > message. :A:B > Constructor :A > :B Preferred

Sequence Diagrams17 Object Destruction An object may destroy another object via a > message. –An object may destroy itself. –Avoid modeling object destruction unless memory management is critical. :A:B >

Sequence Diagrams18 Asynchronous Messages Used for modeling concurrent systems. Caller does not wait for the message to be handled before it continues to execute. –As if the call returns immediately Active objects own an execution thread and can initiate control activity. An asynchronous message can: –Create a new thread (a new activation record) –Create a new object –Communicate with a thread that is already running.

Sequence Diagrams19 Control information Condition –syntax: ‘[‘ expression ’]’ message-label –The message is sent only if the condition is true –example: Iteration –syntax: * [ ‘[‘ expression ‘]’ ] message-label –The message is sent many times to possibly multiple receiver objects. [ok] borrow(member)

Sequence Diagrams20 Control Information (Cont.) Iteration examples: : Driver *[until full] insert() :Bus The syntax of expressions is not a standard : CompoundShape : Shape *draw() draw()

Sequence Diagrams21 Control Information (Cont.) The control mechanisms of sequence diagrams suffice only for modeling simple alternatives. –Consider drawing several diagrams for modeling complex scenarios. –Don’t use sequence diagrams for detailed modeling of algorithms (this is better done using activity diagrams, pseudo-code or state- charts).

Sequence Diagrams22 getViolation(id) Example 1 Clerk :Violations Dialog :Violations Controller :Violations DBProxy lookup viewButton() id=getID() v:Traffic Violation display(v) > v Lookup Traffic Violation May be a pseudo- method DB is queried and the result is returned as an object

Sequence Diagrams23 print(doc,client) Example 2 Client :PrintServer:Queue :Printer Proxy enqueue(job) status Printing A Document job=dequeue() [job]print(job.doc) [job] done(status) Repeated forever with 1 min interludes Active object

Sequence Diagrams24 Example 3 Publishing protocol in the Observer pattern Observer Pattern Class Diagram - reminder

Sequence Diagrams25 Example 3 Sequence Diagram Publishing protocol in the Observer pattern