Sequence Diagrams
This example shows how a sequence diagram represents the interaction between objects as messages or method calls.
Simple message exchange: Alice & Bob
The classic "Hello World" of sequence diagrams shows simple messages between two participants:
This minimal example demonstrates:
- Participants are automatically created from the names used
- Solid arrows (
->) represent synchronous messages - Dashed arrows (
-->) represent responses
Method calls with types: Café ordering
In software design, we use typed participants to show which class or role an object has. The syntax alice: Customer means "alice of type Customer".
This example is more realistic for software design because:
- Participants have types (Customer, Waiter, Wallet)
- The messages resemble method calls with parameters
- There is a return value (confirmation)
- There is a third object (wallet) that alice uses
With a11yDescriptionOverride
When the automatically generated description isn't suitable, you can provide a manual override using the a11yDescriptionOverride attribute. This is useful when you want to refer to an explanation in the surrounding text:
Explanation of the diagram
The sequence diagram above shows the following interaction:
- alice orders - alice calls
orderDrink("apple juice")on bob - bob requests payment - bob returns
pay(2.00)to alice - bob serves - bob calls
serveDrink("apple juice")on alice
The a11yDescriptionOverride is useful when:
- The explanation in the surrounding text provides better context
- The diagram type doesn't have automatic parsing support yet
- You want to provide a more tailored description for your audience