Software System Engineering 11/19/2018 Software System Engineering Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering San José State University One Washington Square San José, CA 95192-0180 http://www.engr.sjsu.edu/~fayad © M.E. Fayad 2000-2006 SJSU -- CmpE
Lesson 3-6b: Sequence Diagrams 11/19/2018 Lesson 3-6b: Sequence Diagrams 2 © M.E. Fayad 2000-2006 SJSU – CmpE M.E. Fayad
3 Lesson Objectives Understand how to generate sequence diagrams 11/19/2018 Lesson Objectives Understand how to generate sequence diagrams Learn the syntax of sequence diagram Explore examples of sequence diagrams 3 © M.E. Fayad 2000-2006 SJSU – CmpE M.E. Fayad
Drawing Sequence Diagrams 11/19/2018 Drawing Sequence Diagrams Place objects that participate in the interaction at the top of the diagram, across the X-axis Place the object that initiates the interaction at the left, and increasingly more subordinate objects to the right Place messages the objects send and receive along the Y-axis, in order of increasing time from top to bottom 4 © M.E. Fayad 2000-2006 SJSU – CmpE M.E. Fayad
11/19/2018 Common Uses Use sequence diagrams to model flows of control by time ordering Do a better job of visualizing simple iteration and branching Use collaboration diagrams to model flows of control by organization Do a better job of visualizing complex iteration and branching and of visualizing multiple concurrent flows of control 5 © M.E. Fayad 2000-2006 SJSU – CmpE M.E. Fayad
6 Sequence Diagrams Sequence diagrams have two features: 11/19/2018 Sequence Diagrams Sequence diagrams have two features: Object lifeline Vertical dashed line that represents the existence of an object over a period of time Focus of control A tall, thin rectangle that shows the period of time during which an object is performing an action, either directly or through a subordinate procedure 6 © M.E. Fayad 2000-2006 SJSU – CmpE M.E. Fayad
Syntax of Sequence Diagram 11/19/2018 Syntax of Sequence Diagram 7 © M.E. Fayad 2000-2006 SJSU – CmpE M.E. Fayad
Sequence Diagram: Example (1) 11/19/2018 Sequence Diagram: Example (1) 8 © M.E. Fayad 2000-2006 SJSU – CmpE M.E. Fayad
Sequence Diagram: Example (2) 11/19/2018 Sequence Diagram: Example (2) 9 © M.E. Fayad 2000-2006 SJSU – CmpE M.E. Fayad
Sequence Diagram: Example (3) 11/19/2018 Sequence Diagram: Example (3) 10 © M.E. Fayad 2000-2006 SJSU – CmpE M.E. Fayad
Sequence Diagram: Example (4) 11/19/2018 Sequence Diagram: Example (4) 11 © M.E. Fayad 2000-2006 SJSU – CmpE M.E. Fayad
Sequence Diagram: Example (5) 11/19/2018 Sequence Diagram: Example (5) 12 © M.E. Fayad 2000-2006 SJSU – CmpE M.E. Fayad
13 Discussion Questions T/F: 11/19/2018 Discussion Questions T/F: The participants in the sequence diagrams are classes and components The sequences in the sequence diagram are connected. Sequence diagram is an event-trace diagram You can generate a sequence diagram / use case. A sequence diagram models flows of control by time ordering 13 © M.E. Fayad 2000-2006 SJSU – CmpE M.E. Fayad