summaryrefslogtreecommitdiff
path: root/localstatecopy.msc
blob: 503d53f08c1f7a9bbc82bb02c4de20233aa4d389 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
msc {
    client [label="Client code"],
    proxy [label="Proxy object"],
    service [label="Service object"];

    proxy note service [label="``Bank account''"];

    |||;

    proxy <: service [label="State: balance=1000"];

    |||;

    client => proxy [label="getBalance()"];
    client << proxy [label="1000"];

    |||;

    client => proxy [label="withdraw(500)"];
    proxy => service [label="Call: withdraw(500)"];
    proxy << service [label="OK"];
    client << proxy [label="OK"];

    |||;

    client => proxy [label="getBalance()"];
    client << proxy [label="500"];

    |||;

    client => proxy [label="withdraw(1000)"];
    client << proxy [label="Error: Insufficient balance!"];
}