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

Slides:



Advertisements
Similar presentations
© 2005 by Prentice Hall Appendix 3 Object-Oriented Analysis and Design Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George.
Advertisements

Chapter 4,Use Case and Statechart Diagrams
Interaction Diagram Notation From Chapter 15 of Craig Larman, Applying UML and Patterns John Dalesandro.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
Sequence Diagrams Show Sequence of Interactions Between Objects.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML.
Interaction Diagrams Software Engineering BIT8. Interaction Diagrams  A series of diagrams describing the dynamic behavior of an object-oriented system.
Introduction To System Analysis and Design
THE OBJECT-ORIENTED DESIGN WORKFLOW UML2 Sequence Diagrams.
L28-S1 Interaction Diagrams 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room.
Bernd Bruegge & Allen Dutoit Object-Oriented Software Engineering: Conquering Complex and Changing Systems 1 UML Sequence Diagrams  Used during system.
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
Sequence Diagrams By Zvika Gutterman Adam Carmi. Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control Information Examples.
Sequence Diagrams By Zvika Gutterman Adam Carmi. Sequence Diagrams2 Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control.
Sequence Diagram. What is Sequence Diagram?  Sequence Diagram is a dynamic model of a use case, showing the interaction among classes during a specified.
© M.E. Fayad SJSU -- CmpE Software System Engineering Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering.
Sequence Diagrams By Zvika Gutterman Adam Carmi. Sequence Diagrams2 Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control.
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.
SEQUENCE DIAGRAM Prepared by: T. Fatimah Alageel.
Introduction To System Analysis and design
CS3773 Software Engineering
UML Collaboration Diagram. Recap System Sequence Diagrams (SSD) UML for SSD Examples.
Class, Sequence and UML Model.  Has actors and use cases.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 25. Review Design Level Class Diagram Identifying classes/Operations/Attributes Associations – Simple associations.
System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD.
1 Behavioral diagrams (2) Lecture p5 T120B pavasario sem.
Introduction To System Analysis and Design
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 2, Modeling with UML.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML: Review Session (Optional)
UML Review of diagram types. 2 Unified Modeling Language The Unified Modeling Language™ (UML) was developed jointly by Grady Booch, Ivar Jacobson, and.
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.
1 An Introduction to UML Interaction (Sequence and Communication) Diagrams Georgia State University CIS 3300 Spring, 2009.
Bernd Bruegge & Allen Dutoit Object-Oriented Software Engineering: Conquering Complex and Changing Systems 1 Software Engineering September 19, 2001 UML.
Interaction Diagrams Interaction Diagrams allow the designer to show how groups of objects collaborate in some behavior. –Interaction Diagrams will show.
Object-Oriented Analysis and Design 1 Mira Balaban & Arnon Sturm Object-Oriented Analysis and Design Session 3a: Behavioral Modeling - Interactions.
UML Diagrams CSC 422 Kutztown University Dr. Daniel Spiegel.
UNIFIED MODELING LANGUAGE(UML) BY Touseef Tahir Lecturer CS COMSATS Institute of Information Technology, Lahore.
Collaboration diagrams. Purpose A collaboration diagram is an alternate way to show a scenario. A collaboration diagram shows the objects and relationships.
Using UML, Patterns, and Java Object-Oriented Software Engineering More on UML Note: Slides are adapted by Linda Sherrell from the Software Engineering.
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
 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.
By Mashael AlDayel Introduction to UML. What is UML? UML (Unified Modeling Language) is a graphical language that is suit-able to express software or.
1 Object Oriented Analysis System modeling = Functional modeling + Object modeling + Dynamic modeling Functional modeling = Use cases Object modeling =class.
1 Systems Analysis and Design Behavioral Modeling Chapter 8 (Last one before the Midterm!)
Systems Analysis and Design in a Changing World, Fourth Edition
Chapter 2, Modeling with UML
EKT 421 SOFTWARE ENGINEERING
Sequence Diagrams Mimi Opkins CECS 493 Fall2016
Sequence Diagrams.
Sequence and Collaboration Diagrams
Activity Diagrams Activity diagrams describe the workflow behavior of a system.  The diagrams describe the state of activities by showing the sequence.
Business System Development
Introduction To System Analysis and Design PART 2
UML Overview Part 2.
Sequence Diagrams.
Interaction diagrams.
UML Diagrams: Sequence Diagrams Dynamic Analysis Model
CIS 375 Bruce R. Maxim UM-Dearborn
Design and Implementation
Unified Modelling Language
Chapter 9: Sequence Diagrams Chapter 5 in Software Engineering Book
Interaction diagrams Interaction diagrams are models that describe how groups of objects collaborate in some behavior. Typically, an interaction diagram.
UML Interaction diagrams
Sequence Diagrams.
CIS 375 Bruce R. Maxim UM-Dearborn
Appendix 3 Object-Oriented Analysis and Design
Presentation transcript:

SEQUENCE DIAGRAM

UML diagrams There are many ways of organizing the UML diagrams. Can be organized as the fallowing: 1. Structural diagrams: to show the building blocks of your systemfeatures that dont change with time. Ex: Class diagram 2. Behavioral diagrams: to show how your system responds to requests or otherwise evolves over time. Ex: Use case diagram 3. Interaction diagrams: Is a type of behavioral diagram. to depict the exchange of messages within a collaboration (a group of cooperating objects). Ex: Sequence diagram & Collaboration diagram

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. 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

Interaction Diagrams UML Collaboration Diagrams Emphasizes structural relations between objects Sequence Diagram The subject of this lecture

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

UML sequence diagrams Used during requirements analysis To refine use case descriptions to find additional objects (participating objects) Used during system design to refine subsystem interfaces Classes are represented by columns Messages are represented by arrows Activations are represented by narrow rectangles Lifelines are represented by dashed lines selectZone() pickupChange() pickUpTicket() insertCoins() Passenger TicketMachine

Nested messages The source of an arrow indicates the activation which sent the message An activation is as long as all nested activations Horizontal dashed arrows indicate data flow Vertical dashed lines indicate lifelines selectZone() Passenger Zone Selection F. TarifScheduleDisplay lookupPrice(selection) displayPrice(price) price Dataflow …to be continued...

Iteration & condition Iteration is denoted by a * preceding the message name Condition is denoted by boolean expression in [ ] before the message name Passenger ChangeProcessor insertChange(coin) CoinIdentifierDisplayCoinDrop displayPrice ( billed Amount) lookupCoin(coin) price [billed Amount<0] returnChange(-billedAmount) Iteration Condition …to be continued... …continued from previous slide... *

Creation and destruction Creation is denoted by a message arrow pointing to the object. Destruction is denoted by an X mark at the end of the destruction activation. In garbage collection environments, destruction can be used to denote the end of the useful life of an object. Passenger ChangeProcessor …continued from previous slide... Ticket createTicket(selection) free() Creation Destruction print()

Software Design (UML) Sequence Diagram An object in a sequence diagram is rendered as a box with a dashed line descending from it. The line is called the object lifeline, and it represents the existence of an object over a period of time. an Order Line

Software Design (UML) Sequence Diagram an Order Linea Stock Item [check = true] remove() check() Messages are rendered as horizontal arrows being passed from object to object as time advances down the object lifelines. Conditions ( such as [check = true] ) indicate when a message gets passed.

Software Design (UML) Sequence Diagram an Order Linea Stock Item [check = true] remove() check() Notice that the bottom arrow is different. The arrow head is not solid, and there is no accompanying message. This arrow indicates a return from a previous message, not a new message.

Software Design (UML) Sequence Diagram an Ordera Order Line * prepare() An iteration marker, such as * (as shown), or *[i = 1..n], indicates that a message will be repeated as indicated. Iteration marker

Software Design (UML) an Order Entry window an Orderan Order Linea Stock Item A Reorder Item A Delivery Item new [check = true] new [needsToReorder = true] needsToReorder() [check = true] remove() check() * prepare() prepare() Object Message Iteration Return Creation Condition Self-Delegation [Fowler,97]

Basic Elements of a Sequence Diagram Active Objects Actors or Objects Notated using the UML notation for class instances Life line appears below active objects to indicate their lifespan Messages Arrowed lines that indicated communication between objects

Three Active Objects with Two Messages ChessboardDatabase Chess Player make move record move critique

Message Types Synchronous message (wait for return) Return messages ( response to previous message) Asynchronous messages (no wait) Flat (unspecified synchronization) Note closed arrowhead

Creating/Deleting Objects Send messages > and > Chessboard Database > critique >

Conditional Messages Chessboard Database > critique [unfavorable critique] >

Branching ChessboardDatabase Chess Player [make move] critique [resign]

Alternative Flow ChessboardDatabase Chess Player [make move] [game over]

Control Rectangles Show when an object is involved in a sequence of messages ChessboardChessEngine Request Position Request Evaluation Database Record Data

Modeling Time Chess ClientChess Server Send Players Move Send Opponents Move Diagonal message lines indicate that the messages take time to transmit

Specifying a Time Constraint on a message Chess ClientChess Server Send Players Move Send Opponents Move {sendTime for players move<2 seconds}

Modeling Loops Chess ClientChess Server Send Players Move Send Opponents Move *[while !gameOver]

Modeling Recursion ApplicationSorter Sort List

Arguments and Return Values Web InterfaceDatabase GPA = RequestGPA(studentName)

Adding Notes to Diagrams Chess ClientChess Server Send Players Move Send Opponents Move Send a move and get a move. If connection is lost, an automatic reconnect is attempted.

System Diagram notation Which would you expect to find most often in a sequence diagrams?

Sequence Diagram Notation Figure 15.7

What does vertical placement communicate? Figure 15.10

Examples

Example 1: Part of a Vending Machine

Example 2: ATM

Example 2: ATM in Detail

Example 3: Shopping Cart

Example 4: Video Rental

Sequence Diagram Summary UML sequence diagram represent behavior in terms of interactions. Useful to find missing objects. Time consuming to build but worth the investment. Complement the class diagrams (which represent structure).