system sequence diagrams. recap when to create ssd? how to identify classes/instances? use case...
TRANSCRIPT
![Page 1: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/1.jpg)
System Sequence Diagrams
![Page 2: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/2.jpg)
Recap
• When to create SSD?• How to identify classes/instances?• Use case descriptions• UML notations for SSD
![Page 3: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/3.jpg)
Contents
• Interaction diagrams• UML notation• Examples
![Page 4: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/4.jpg)
Interaction Diagrams
• Show how objects interact with one another
• UML supports two types of interaction diagrams Sequence diagramsCollaboration diagrams
![Page 5: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/5.jpg)
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
![Page 6: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/6.jpg)
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
![Page 7: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/7.jpg)
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
![Page 8: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/8.jpg)
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
![Page 9: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/9.jpg)
Sequence Diagram (Basic)
Object : Class or Actor
Lifeline
message
name
X ObjectDestruction/Termination
<<create>><<destroy>>
Focus of Control/Activation
![Page 10: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/10.jpg)
Sequence Diagram (Basic)
Student
aClass:Class
Register
:Scheduler
adjustRoom checkRooms
![Page 11: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/11.jpg)
Sequence Diagrams (Advanced)
Seq# [Guard] *[Iteration] Return-List := Operation-Name (Argument-List)
recursion
*[Iteration Condition]
ConditionalLifeline {transient}
![Page 12: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/12.jpg)
Sequence Diagram(make a phone call)
Caller Phone Recipient
Picks up
Dial tone
Dial
Ring notification Ring
Picks up
Hello
![Page 13: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/13.jpg)
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
BCreate
XDeletion
Return
Lifeline
![Page 14: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/14.jpg)
Sequence diag. from use case
14
![Page 15: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/15.jpg)
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
![Page 16: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/16.jpg)
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
![Page 17: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/17.jpg)
Messages between objects• message (method call) indicated by horizontal arrow
to other object– write message name and arguments above arrow
17
![Page 18: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/18.jpg)
Messages between objects– dashed arrow back indicates return– different arrowheads for normal / concurrent
(asynchronous) methods
![Page 19: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/19.jpg)
Example
![Page 20: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/20.jpg)
Example
![Page 21: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/21.jpg)
Example
![Page 22: System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD](https://reader036.vdocument.in/reader036/viewer/2022062517/56649ea85503460f94baafd1/html5/thumbnails/22.jpg)
Summary
• SSD revision• Loops• Conditions in SSD