300 likes | 958 Views
UML Sequence Diagrams. 2 December 2010. UML Diagrams. Structure diagram Class diagram Object diagram Component diagram Deployment diagram Package diagram. Behaviour diagram Use Case diagram Activity diagram Interaction diagram Sequence diagram Communication diagram. 2.
E N D
UML Sequence Diagrams 2 December 2010
UML Diagrams Structure diagram Class diagram Object diagram Component diagram Deployment diagram Package diagram Behaviour diagram Use Case diagram Activity diagram Interaction diagram Sequence diagram Communication diagram 2
In a nutshell: what are interactions? • A collection of communications between instances, including all ways to affect instances, like operation invocation, as well as creation and destruction of instances • The communications are partially ordered (in time) 3
Interaction Diagram Guide • Show interactions between instances in the model • graph of instances (possibly including links) and stimuli • existing instances • creation and deletion of instances • Kinds • Sequence diagram (temporal focus) • Communication diagram (structural focus) 4
Sequence Diagram Communication Diagram x y z 1.1: a1.2: c x y a b 1.1.1: b c z Interaction Diagrams 5
Lifeline & Messages • The vertical line is called the object’s lifeline. The lifeline represents the object’s life during the interaction. • Each message is represented by an arrow between the lifelines of two objects. • The order in which these messages occur is shown top to bottom. • Each message is labeled at minimum with the message name; also arguments and some control information can be included. • A self-back is a message that an object sends to itself, by sending the message arrow back to the same lifeline.
Sequence Diagram vs. Communication Diagram • Sequence diagrams are used when you want to look at the behavior of several objects within a single use case. Sequence diagrams are good at showing collaborations among the objects. • Communication diagrams emphasize the data links between the various participants in the interaction. With communication diagrams we can show how the participants are linked together. 9
Next Concepts Sequence Diagrams 1of2 control guard
Next Concepts Sequence Diagrams 2of2 constraint { a b-a < 5 sec b b'-b < 1 sec b' }
: Order Entry Window : Order : Order Line : Stock Item SEQUENCE DIAGRAM : Reorder Item : Delivery Item
: Transaction : Transaction Coordinator : first Transaction Checker : second Transaction Checker Concurrent Processes and Activations
: Transaction : Transaction Coordinator : first Transaction Checker : second Transaction Checker SEQUENCE DIAGRAM: Check Failure
Use Case Description: Change Flt Itinerary • Actors: traveler, client account db, airline reservation system • Preconditions: Traveler has logged in • Basic course: • Traveler selects ‘change flight itinerary’ option • System retrieves traveler’s account and flight itinerary from client account database • System asks traveler to select itinerary segment she wants to change; traveler selects itinerary segment. • System asks traveler for new departure and destination information; traveler provides information. • If flights are available then … • … • System displays transaction summary. • Alternative course: • If no flights are available then…
Traveler Client Account DBMS Client Account DBMS Airline Reservation System : Booking System change flight itinerary get customer account select segment update information present itinerary present detailed info get itinerary available flight Sequence Diagram: Change Flight Itinerary
1: change flight itinerary 2: get customer account3: get itinerary : Booking System 4: present itinerary Client Account DBMS Traveler 8: available flight Airline Reservation System Collaboration Diagram: Change Flt Itinerary 5: select segment 7: update information 6: present detailed info