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.

Slides:



Advertisements
Similar presentations
Concepts & Notations. Acknowledgements  The material in this tutorial is based in part on: The Unified Modeling Language Reference Manual, 2 nd edition,
Advertisements

System Sequence Diagrams
1 Behavioral Modeling Chapter 8. 2 Key Ideas Behavioral models describe the internal dynamic aspects of an information system that supports business processes.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
System Sequence Diagrams (SSD). Recap Concepts of Action, Pins and Activity Description of activity nodes and activity edges New notations – Activity.
Interaction Diagrams Activity Diagram State Machine Diagram
Lecture 5 …a bit more about UML Sequence diagrams Collaboration diagrams State-chart diagrams CRC cards.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 5: Restaurant.
THE OBJECT-ORIENTED DESIGN WORKFLOW UML2 Sequence Diagrams.
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
Essentials of interaction diagrams Lecture 23 & 24.
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
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 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.
7M822 UML Interaction Diagrams 25 November 2010.
Slide 1 Chapter 8 Behavioral Modeling. Slide 2 Key Ideas Behavioral models describe the internal dynamic aspects of an information system that supports.
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.
Object-oriented design Part 4: More UML. Interfaces An interface is a language construct specific to Java Java does not support multiple inheritance Interfaces.
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.
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.
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.
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.
Slide 1 Use Case Sequence Diagram Explained. Slide 2 Steps for Building a Sequence Diagram 1)Set the context 2)Identify which objects and actors will.
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.
9-1 © Prentice Hall, 2007 Chapter 9: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.
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.
 C-style pointer-based arrays  Have great potential for errors and several shortcomings  C++ does not check whether subscripts fall outside the range.
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.
Sequence Diagrams CSIS3600. Sequence Diagrams A sequence diagram shows an interaction arranged in time sequence. In particular, it shows the objects participating.
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”
7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.
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 Kyung Hee University Interaction Diagrams Spring 2001.
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
Chapter 7 Behavioral Modeling Brandon A. Jones Stand and Deliver ITEC March 6, 2011.
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.
Analysis Classes Unit 5.
Collaboration Diagrams
Sequence Diagrams Mimi Opkins CECS 493 Fall2016
COMP 2710 Software Construction Sequence Diagrams (cont.)
Sequence Diagram.
Behavioral Modeling.
Sequence Diagrams.
Princess Nourah bint Abdulrahman University
Princess Nourah bint Abdulrahman University
Sequence Diagrams.
Sequence Diagrams Getting the Message.
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.
Presentation transcript:

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 objects interact to complete the task of the use case. They portray the interaction among the objects of a system and describe the dynamic behavior of the system. l There are two types of interaction diagrams l Sequence Diagrams and Communication Diagrams (formally known as collaboration diagrams)

Slide 3 Interaction Diagrams l Sequence diagrams generally show the sequence of events that occur. l Collaboration diagrams demonstrate how objects are statically connected. l Both diagrams are relatively simple to draw and contain similar elements.

Slide 4 Interaction Diagrams l Purpose of interaction diagrams Model interactions between objects Assist in understanding how a system (i.e., 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

Slide 5 Sequence Diagram l Illustrates the objects that participate in a use case and the messages that pass between them over time for one use case l In design, used to distribute use case behavior to classes

Slide 6 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 Focus of control Condition

Slide 7 Sequence Diagram Syntax AN ACTOR AN OBJECT A LIFELINE A FOCUS OF CONTROL A MESSAGE OBJECT DESTRUCTION anObject:aClass aMessage() x

Slide 8 Sequence Diagram Two major components Active objects Communications between these active objects Messages sent between the active objects

Slide 9 Sequence Diagram Active objects Any objects that play a role in the system Participate by sending and/or receiving messages Placed across the top of the diagram Can be: An actor (from the use case diagram) Object/class (from the class diagram) within the system

Slide 10 Active Objects Object Can be any object or class that is valid within the system Object naming Syntax [instanceName][:className] 1.Class name only :Classname 2.Instance name only objectName 3.Instance name and class name together object:Class myBirthdy :Date

Slide 11 Active Objects Actor A person or system that derives benefit from and is external to the system Participates in a sequence by sending and/or receiving messages

Slide 12 Sequence Diagram

Slide 13 Communications between Active Objects Messages Used to illustrate communication between different active objects of a sequence diagram Used when an object needs to activate a process of a different object to give information to another object

Slide 14 Messages A message is represented by an arrow between the life lines of two objects. Self calls are allowed A message is labeled at minimum with the message name. Arguments and control information (conditions, iteration) may be included.

Slide 15 Types of Messages  Synchronous (flow interrupt until the message has completed)  Asynchronous (don’t wait for response)  Flat (no distinction between sysn/async)  Return (control flow has returned to the caller)

Slide 16 Synchronous Messages l The routine that handles the message is completed before the calling routine resumes execution. :A:B doYouUnderstand() Caller Blocked return (optional) yes

Slide 17 Asynchronous Messages  Calling routine does not wait for the message to be handled before it continues to execute.  As if the call returns immediately  Examples  Notification of somebody or something  Messages that post progress information

Slide 18 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()

Slide 19 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 Focus of control Condition

Slide 20 Other Elements of Sequence Diagram  Lifeline  Focus of control (activation box or execution occurrence)  Control information  Condition, repetition

Slide 21 Sequence Diagram  Lifeline  Denotes the life of actors/objects over time during a sequence  Represented by a vertical line below each actor and object (normally dashed line)  For temporary object  place X at the end of the lifeline at the point where the object is destroyed

Slide 22 Sequence Diagram  Focus of control (activation box)  Means the object is active and using resources during that time period  Denotes when an object is sending or receiving messages  Represented by a thin, long rectangular box overlaid onto a lifeline

Slide 23 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 Focus of control Condition

Slide 24 Control Information  Condition  syntax: ‘[‘ expression ’]’ message-label  The message is sent only if the condition is true [ok] borrow(member)

Slide 25 Elements of Sequence Diagram obj1:Class [x < 15] calculate() obj2: Class message()

Slide 26 Sequence Diagrams obj1:Class [x < 15] calculate() obj2: Class message() obj3: Class [x > 20] calculate()

Slide 27 Sequence Diagrams l Concurrency obj1:Class calculate() obj2: Class message() obj3: Class calculate()

Slide 28 Elements of Sequence Diagram  Control information  Iteration  may have square brackets containing a continuation condition (until) specifying the condition that must be satisfied in order to exit the iteration and continue with the sequence  may have an asterisk followed by square brackets containing an iteration (while or for) expression specifying the number of iterations

Slide 29 Control Information  Iteration  syntax: * [ ‘[‘ expression ‘]’ ] message-label  The message is sent many times to possibly multiple receiver objects. *draw()

Slide 30 Control Information  Iteration example : Driver *[until full] insert() :Bus : CompoundShape : Shape *draw() draw()

Slide 31 Control Information  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).

Slide 32 Sequence Diagrams  Creation and destruction of an object in sequence diagrams are denoted by the stereotypes > and > :Creator > : Created Object message() > X

Slide 33 Creating Objects  Notation for creating an object on- the-fly  Send the > message to the body of the object instance  Once the object is created, it is given a lifeline.  Now you can send and receive messages with this object as you can any other object in the sequence diagram.

Slide 34 Object Creation  An object may create another object via a > message. :A:B > Constructor :A > :B Preferred

Slide 35 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 >

Slide 36 getViolation(id) Sequence Diagram Clerk :Violations Dialog :Violations Controller :Violations DBProxy lookup viewButton() id=getID() v:Traffic Violation display(v) > v Lookup Traffic Violation DB is queried and the result is returned as an object

Slide 37 Steps for Building a Sequence Diagram 1)Set the context 2)Identify which objects and actors will participate 3)Set the lifeline for each object/actor 4)Lay out the messages from the top to the bottom of the diagram based on the order in which they are sent 5)Add the focus of control for each object’s or actor’s lifeline 6)Validate the sequence diagram

Slide 38 1)Set the context. a)Select a use case. b)Decide the initiating actor. Steps for Building a Sequence Diagram

Slide 39 2)Identify the objects that may participate in the implementation of this use case by completing the supplied message table. a) List candidate objects. 1)Use case controller class 2)Domain classes 3)Database table classes 4)Display screens or reports Steps for Building a Sequence Diagram

Slide 40 Steps for Building a Sequence Diagram 2)Identify the objects (cont.) b)List candidate messages. (in message analysis table) 1)Examine each step in the normal scenario of the use case description to determine the messages needed to implement that step. 2)For each step: 1)Identify step number. 2)Determine messages needed to complete this step. 3)For each message, decide which class holds the data for this action or performs this action 3)Make sure that the messages within the table are in the same order as the normal scenario

Slide 41 Steps for Building a Sequence Diagram 2)Identify the objects (cont.) c)Begin sequence diagram construction. 1)Draw and label each of the identified actors and objects across the top of the sequence diagram. 2)The typical order from left to right across the top is the actor, primary display screen class, primary use case controller class, domain classes (in order of access), and other display screen classes (in order of access) 3)Set the lifeline for each object/actor

Slide 42 4) Lay out the messages from the top to the bottom of the diagram based on the order in which they are sent. a)Working in sequential order of the message table, make a message arrow with the message name pointing to the owner class. b)Decide which object or actor initiates the message and complete the arrow to its lifeline. c)Add needed return messages. d)Add needed parameters and control information. Steps for Building a Sequence Diagram

Slide 43 5)Add the focus of control (activation box) for each object’s or actor’s lifeline. 6)Validate the sequence diagram. Steps for Building a Sequence Diagram

Slide 44 Sequence Diagrams :Cashier makenewSale() : System enterItem(itemID, quantity) description, total endSale() total makePayment(amount) change due, receipt

Slide 45 Sequence Diagram

Slide 46 Sequence Diagram :CompilerLinker Actor Compile FileSystem Load Files Save OBJ Files Compile files Link Load OBJ files Link OBJ files Write EXE file