Reputation: 13
I have created a Sequence Diagram that I wish to convert to a Communication/Collaboration Diagram. I understand the conversion and the numbering process but I am wondering since my Sequence diagram have loops that are under the alt fragment, how is their numbering going to be in Communication Diagram?
Here a sample of my Sequence Diagram that have one of those loops:
Edit: What I want to know here is that since the loop is an IF
situation, is it still OK to number those sequences? I don't think it would make logic if user's communication is, 1.0 Enter registered Username and Password
, 2.0 Re-enter registered Username and Password
...2.0 here is the IF loop situation
Upvotes: 0
Views: 2206
Reputation: 73406
Communication diagram and sequence diagram represent the same interactions from a different angle. But the simplified graphical representation of the messages implies restrictions in the communication diagram when it comes to combined fragments.
In the communication diagram you can represent:
1
,2
,3
and decimal numbering, e.g. 2.1
, 2.2
, 2.2.1
loop
operator in sequence diagram), using a *
following the number. More specific looping specifications could follow the start between brackets e.g. *[1..n]
or *[element in collection]
. Your loop conditions are unspecified in the sequence diagram, so a *
would do.opt
operator in sequence diagram), using a condition between brackets after the number e.g.[t>10]
In your example, we could therefore imagine: `
1: Enters username and passord
2: Check validity
2.1*: Mismatch of name or password // return message, not usual
2.2: Prompt user to re-enter credentials
2.3: Re-enter username and password
2.4: Re-check validity // missing in the SD in the loop
3: Verify user
4: USer verified
5: Display profile
Now there are two issues here: first, in your sequence diagram, there is a missing check validity
in the loop. Second, I showed for simplicity all the messages, but in a communication diagram you would usually not sho return messages, to keep things simpler. So we'd have a slightly simpler model:
1: Enters username and passord
2: Check validity //message, return is implicit
3.1*[credentials invalid]: Prompt user to re-enter credentials
3.2: Re-enter username and password
3.3: Check validity
4: Read user
5: Display profile
Advice for the choice between SD and CD:
Upvotes: 0