Reputation: 1913
I've found this tutorial on sequence diagrams very helpful but I'm having trouble understanding a couple of things in diagram 11:
Why is the customer lifeline not activated after sending the WithdrawCash
message? My understanding is that an object awaiting a response should be activated.
Why isn't the cash
return message included in the opt [balance > amount]
?
Wouldn't this imply that the customer gets cash even in case the conditions aren't met, since cash
is sent regardless (outside) of the opt?
Upvotes: 1
Views: 233
Reputation: 36305
opt
fragment (that rectangle area) says that the contents inside is only executed optional. So the debit
message is only sent when balance > amount
(the guard in square brackets). The example is inaccurate as it does not handle the "no cash returned" path (some error handling).Upvotes: 0