Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the Sequence Diagram per use case in UML or we draw it for the System in general?

Tags:

uml

argouml

I discuss with my friend our project and we are in a way to draw the sequence diagram ( UML 2). He told me that the sequence diagram is drawn by the use case. It means that for each use case we should draw a Sequence Diagram. Is it correct ? Thank you for any suggestion.

like image 684
Rodrigo Avatar asked Feb 13 '16 12:02

Rodrigo


2 Answers

Well, taken as dogma it is not correct. A sequence diagram (SD) shows the behavior of objects in the way they interchange messages (and also if needed their lifetime and some minor additional information). You "can" also use a sequence diagram to describe scenarios in use cases. But simply speaking, a SD is more technically oriented (class design/programmers) rather than business (business design/stakeholders). To visualize a use case scenario you're better off using activity diagrams (AD). And even better if you dive into BPMN (which brings ADs to a new level).

It is possible though, to convert ADs to SDs and vice versa without information loss (if you forget about the afore mentioned bits and pieces).

Now another point: you will not necessarily need a diagram for each use case. I found that often use cases are more easily (and even clearly) described in a textual way (see Cockburn or Bittner/Spence) rather than diagrammatically. Especially if you have UC scenarios that are very linear in their single actions. So you can leave out the AD for those and just fall back to simple text. You should further avoid describing UC scenarios in both ways (i.e. text and diagram) as this introduces unwanted redundancy (means you would need to maintain always both when changes happen; and they happen often; and people are lazy -> so which one holds the truth: text or diagram?).

like image 179
qwerty_so Avatar answered Sep 29 '22 05:09

qwerty_so


Generally, as Thomas points out, use case detail is set forth in an activity diagram. As he also mentions, a use case scenario would use a sequence diagram, when necessary. A use case scenario is a single path through a use case.

Sequence diagrams aren't good at diagramming multiple simultaneous behaviors and multiple decision points, and use cases generally have both of these features in their behavior. Activity diagrams do these things very well. A single path through a use case, by definition, doesn't have simultaneous behaviors and decision points, so a sequence diagram is more appropriate.

Googling "use case scenario sequence diagram" gives a number of links that explain the use of sequence diagrams for use case scenarios in detail, of which this is an example.

like image 31
BobRodes Avatar answered Sep 29 '22 07:09

BobRodes