2
votes

I'm drawing a SEQUENCE DIAGRAM o a Public Phone (PP) system. What I am trying to do is : - A message for : The caller enters money and sends a call request with the callee phone number - A message for : PP Calculates the duration time of the call - A message for : PP printing call duration limit to the CALLER - A message for : The caller and the callee communicates during the call time calculated --> this message is sort of a duration message - A message for : PP detecting end of call time - A message for : For ending comunication

Below is a picture of what I'm trying to do:

enter image description here

How SHOULD I properly reprensent the Messages (especially Message 4 and the others after it ) WITHOUT a LOOP fragment here ? So that the duration is still obvious with the oblique line ...and that Message 10 is the one closing the duration of Message 4

Edited Diagram enter image description here

LAST altered diagram <--- OK !!!

I think that one sums up what you've both said

enter image description here

2

2 Answers

2
votes

The message 4 must not be drawn angled since this signals a duration of the message itself.

Again, you can make use of fragments:

enter image description here

The alt has a default and a timeout. You might augment this with an activity diagram that has a critical region which allows to show such timing constraints in a better way.

enter image description here

1
votes

You cannot show the participants talking without a loop. It does not take the duration XX:XX to send message 4. That seems to abuse UML.

You would be better off using asynchronous messages (the ones with open arrowheads). One to start the call, many back and forth messages between the caller and callee through the phone, and one to end the call. The back and forth messages through the phone can be shown as optional, parallel, and looping.

It seems what you should really be using is a state machine diagram. That would allow you to express all the allowed traces of this protocol, including what happens when a time limit is reached. A sequence diagram usually illustrates a subset of all the allowed traces. If you try to show them all, the diagram can become hard to read and nearly impossible to maintain.