Sequence Diagrams
A sequence diagram is a UML diagram that provides a view of the chronological sequence of messages between instances (objects or classifier roles) that work together in an interaction or interaction instance. A sequence diagram consists of a group of instances (represented by lifelines) and the messages that they exchange during the interaction. You line up instances participating in the interaction in any order from left to right, and then you position the messages that they exchange in sequential order from top to bottom. Activations sometimes appear on the lifelines.
Note You can delete a lifeline from a sequence diagram without deleting the object or classifier role by using the Delete from Model command on the diagram window short-cut menu.
Shapes and Connectors
A sequence diagram can contain shapes and connectors that represent:
Types of Sequence Diagrams
A sequence diagram belongs to an interaction in a collaboration or an interaction instance in a collaboration instance. If you are working with an interaction in a collaboration you use a sequence role diagram. If you are working with an interaction instance in a collaboration instance you use a sequence instance diagram.
Using Sequence Diagrams
Sequence diagrams are used to model interactions. Often, they are used to model interactions in the following situations:
-
During analysis, you can use sequence diagrams to model what the class instances do in order to realize a use case. Usually, there is one sequence diagram that illustrates the main flow of events in the use case and additional diagrams that model important alternate flows. The instances sometimes maintain the boundary class, entity class, or control class stereotypes of their classes to indicate that they are analysis classes. Sequence diagrams developed during the analysis phase help identify the classes needed in a system and what their objects need to do in interactions.
-
During design, you can refine the sequence diagrams that have been developed in the analysis phase to model how the system actually completes the interactions. For example, architectural patterns are incorporated where appropriate, and actual class operations are assigned to messages. Sequence diagrams developed during the design phase explain how the system works to accomplish interactions.
-
During the development of a system architecture, you can use sequence diagrams to model the behaviors of design patterns and mechanisms that will be used in the system.
Related Topics
- Working with Interaction (Sequence) Diagrams
- Collaboration Instances
- Collaborations
- Interaction Instances
- Interactions
|