2.5. UML Sequence Diagram

2.5.1. Rationale

2.5.2. 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.5.3. Conversation

```mermaid
sequenceDiagram

    participant Alice
    participant Bob

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

2.5.4. 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.5.5. 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.5.6. Use Cases

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