Presentation is loading. Please wait.

Presentation is loading. Please wait.

System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD.

Similar presentations


Presentation on theme: "System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD."— Presentation transcript:

1 System Sequence Diagrams

2 Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD

3 Contents Interaction diagrams UML notation Examples

4 Interaction Diagrams Show how objects interact with one another UML supports two types of interaction diagrams  Sequence diagrams  Collaboration diagrams

5 Sequence Diagrams AKA Interaction Diagrams – Semantically equivalent to Collaboration Diagrams Dynamic Model relating use cases and class diagrams Illustrates how objects interacts with each other Shows time ordering of interactions Generally a set of messages between collaborating objects Ordering of objects not significant

6 Sequence Diagrams Show only one flow of control Can model simple sequential flow, branching, iteration, recursion and concurrency May need multiple diagrams – Primary – Variant – Exceptions

7 UML sequence diagrams sequence diagram: an "interaction diagram" that models a single scenario executing in the system – perhaps 2nd most used UML diagram (behind class diagram) relation of UML diagrams to other exercises: – CRC cards -> class diagram – use cases -> sequence diagrams 7

8 Key parts of a sequence diag. participant: an object or entity that acts in the sequence diagram – sequence diagram starts with an unattached "found message" arrow message: communication between participant objects the axes in a sequence diagram: – horizontal: which object/participant is acting – vertical: time (down -> forward in time) 8

9 Sequence Diagram (Basic) Object : Class or Actor Lifeline message name X Object Destruction/ Termination > Focus of Control/ Activation

10 Sequence Diagram (Basic) Student aClass: Class Register :Scheduler adjustRoom checkRooms

11 Sequence Diagrams (Advanced) Seq# [Guard] *[Iteration] Return-List := Operation-Name (Argument-List) recursion *[Iteration Condition] Conditional Lifeline {transient}

12 Sequence Diagram(make a phone call) CallerPhoneRecipient Picks up Dial tone Dial Ring notificationRing Picks up Hello

13 Sequence Diagrams – Object Life Spans Creation  Create message  Object life starts at that point Activation  Symbolized by rectangular stripes  Place on the lifeline where object is activated.  Rectangle also denotes when object is deactivated. Deletion  Placing an ‘X’ on lifeline  Object’s life ends at that point Activation bar A B Create X Deletion Return Lifeline

14 Sequence diag. from use case 14

15 Lifetime of objects creation: arrow with 'new' written above it – notice that an object created after the start of the scenario appears lower than the others deletion: an X at bottom of object's lifeline – Java doesn't explicitly delete objects; they fall out of scope and are garbage-collected 15

16 Representing objects squares with object type, optionally preceded by object name and colon – write object's name if it clarifies the diagram – object's "life line" represented by dashed vert. line 16

17 Messages between objects message (method call) indicated by horizontal arrow to other object – write message name and arguments above arrow 17

18 Messages between objects – dashed arrow back indicates return – different arrowheads for normal / concurrent (asynchronous) methods

19 Example

20

21

22 Summary SSD revision Loops Conditions in SSD


Download ppt "System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD."

Similar presentations


Ads by Google