CPSC 3720 - DAY 15 FEBRUARY 20, 2017 ================================================================================ SEQUENCE DIAGRAMS ----------------- A sequence diagram ties use cases with objects. Shows how the behavior of a use case is distributed among obj. Not used to communicate with the user or customer Too technical Typically covers one scenario Can include conditional statements, but they can clutter up the diagram quickly You need at least one sequence diagram for each use text. CH 4 UML Distilled Sequence Diagrams At the top there are participants. Actors and objects Sometimes objects will have the name and the class Each Participant has a vertical lifeline Shows how long the object lives in the systems memory Rectangles on the line show that the object is actively processing something Participants send messages to other participants via an arrow from one life line to another Messages are function calls (include parameters) Dashed arrows are returns First message is the found message Can come from an Actor, or no specific participant The horizontal level of the arrows show the temporal relationship Creation and deletion of objects One participant can create another participant by using the found msg "new" to show the instantiation of an object (or create) Similar to new when calling the constructor of an object The rectangle of the created participant is on the same horiz level as that message. A participant's life can end Shown with a large X and the life-line ending Can be done with a close command Can be self-deletion Loops and conditionals Not a strength of sequence diagrams, but not bad Activity diagrams are better though, or even just pseudo code Loops and conditionals use interaction frames Seperate part of the sequence diagram Each frame can have one or more fragments Fragments are used to show the seperate paths based on the condition Each fragment has a guard which shows the condition for entering that fragment Each frame has an operator in the top left corner to show what kind of operation it is. Heuristics First column should correspond to actor who initiated the use case Second column should be boundry object Third column should be control object Control object created by boundry object initiating the use case Entitiy objects accessed by control objects Entity objects never access boundry or control objects This makes it easier to share entity objects across use cases.