Lifelines
A lifeline is a named element which depicts an individual participant in a sequence diagram. So basically each instance in a sequence diagram is represented by a lifeline. Lifeline elements are located at the top in a sequence diagram. The standard in UML for naming a lifeline follows the following format:
Instance Name : Class Name
We display a lifeline in a rectangle called head with its name and type. The head is located on top of a vertical dashed line (referred to as the stem) as shown above.
- If we want to model an unnamed instance, we follow the same pattern except now the portion of lifeline’s name is left blank.
- Difference between a lifeline and an actor
- A lifeline always portrays an object internal to the system whereas actors are used to depict objects external to the system.
The following is an example of a sequence diagram:
Sequence Diagrams | Unified Modeling Language (UML)
Unified Modelling Language (UML) is a modeling language in the field of software engineering that aims to set standard ways to visualize the design of a system. UML guides the creation of multiple types of diagrams such as interaction, structure, and behavior diagrams. A sequence diagram is the most commonly used interaction diagram.
Interaction diagram
An interaction diagram is used to show the interactive behavior of a system. Since visualizing the interactions in a system can be difficult, we use different types of interaction diagrams to capture various features and aspects of interaction in a system.
- A sequence diagram simply depicts the interaction between the objects in a sequential order i.e. the order in which these interactions occur.
- We can also use the terms event diagrams or event scenarios to refer to a sequence diagram.
- Sequence diagrams describe how and in what order the objects in a system function.
- These diagrams are widely used by businessmen and software developers to document and understand requirements for new and existing systems.
Important Topics for the Sequence Diagrams
- Sequence Diagram Notation
- Actors
- Lifelines
- Messages
- Create message
- Delete Message
- Self Message
- Reply Message
- Found Message
- Lost Message
- Guards
- How to create Sequence Diagrams?
- Use cases of Sequence Diagrams
- Challenges of using Sequence Diagrams