I have a class called booking that requires a payment to be completed and also requires a confirmation to be sent. I have three classes: booking, confirmation and payment but I'm not sure how to demonstrate that the booking class requires both a payment to be completed and a confirmation to be sent. I considered using composition but I'm not entirely sure.
1 Answer
A class diagram will only show structure, but you are talking about behavior. You will show that in either a sequence or an activity diagram.
Here I made the Confirmation an association class which connects Booking and Payment.
And this is a simplistic representation of what happens when doing a booking.
N.B. with regards to @granier's comments:
P. 373 of the specs
When a node completes execution, a token is removed from the node and tokens are offered to some or all of its outgoing ActivityEdges.
P. 401
An ExecutableNode may also consume and produce data, but it must do so through related ObjectNodes.
...
That is, there is an implicit fork of the flow of control from the ExecutableNode to its outgoing ControlFlows.
10 Comments
Send confirmation has an implicit fork (you remember?). And elements with no outgoing flow swallow the token when done (written somewhere else). So that's absolutely correct. Actually the flow to final from Send... could be omitted too.
