2.10. UML Sequence Diagram

2.10.1. Connections

  • -> - Solid line without arrow

  • --> - Dotted line without arrow

  • ->> - Solid line with arrowhead

  • -->> - Dotted line with arrowhead

  • -x - Solid line with a cross at the end (async)

  • --x - Dotted line with a cross at the end (async)

2.10.2. Conversation

```mermaid
sequenceDiagram

    participant Alice
    participant Bob

    Alice ->> Bob: Hello, how are you?
    Bob -->> Alice: Great!
```
../../_images/uml-mermaid-sequencediagram-alicebob.png

2.10.3. Nested

```mermaid
sequenceDiagram

    participant Client
    participant Server
    participant Database

    activate Client
    Client ->> +Server: HTTP Request
    Server ->> +Database: SQL Query
    Database -->> -Server: Result
    Server -->> -Client: HTTP Response
    deactivate Client
```
../../_images/uml-mermaid-sequencediagram-web.png

2.10.4. Async

```mermaid
sequenceDiagram

participant Client
participant Server
participant Database

activate Client

Client -x +Server: HTTP Request
Client -x Server: HTTP Request
Server ->> +Database: SQL Query
Client -x Server: HTTP Request
Client -x Server: HTTP Request
Client -x Server: HTTP Request

Database -->> -Server: Result

Server --x -Client: HTTP Response

deactivate Client
```

2.10.5. Rationale

../../_images/uml-sequencediagram-1.png
../../_images/uml-sequencediagram-2.jpg