sequenceDiagram
Withdraw --> Balance:
Note right of Balance: balance=100
Balance ->> Deposit: 100
Note right of Deposit: Dep = 100+100 = 200
Deposit ->> Balance: 200
Note right of Balance: balance=200
Balance ->> Withdraw: 200
Note left of Withdraw: Wit = 200-100 = 100
Withdraw ->> Balance: 100
Note right of Balance: balance=200
What might very well happen instead
sequenceDiagram
Withdraw --> Balance:
Note right of Balance: balance=100
Balance ->> Deposit: balance: 100
Note right of Deposit: Dep = 100+100 = 200
Balance ->> Withdraw: balance: 100
Note right of Withdraw: Wit = 100-100 = 0
Withdraw ->> Balance: set: 0
Note right of Balance: balance=0
Deposit ->> Balance: 200
Note right of Balance: balance=200