Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UML sequence diagram

Tags:

uml

I have a question regarding sequence diagrams.

When drawing sequence diagrams,

Is it enough to draw one diagram per user case ?

or do we need to draw a set of sequence diagrams to cover each user case instance ? (is a sequence of actions a system performs that yields an observable result of value to a particular Use Case Actor)

like image 970
Upul Bandara Avatar asked Mar 21 '10 16:03

Upul Bandara


People also ask

What is the sequence of UML diagrams?

Sequence Diagrams – A sequence diagram simply depicts interaction between objects in a sequential order i.e. the order in which these interactions take place. We can also use the terms event diagrams or event scenarios to refer to a sequence diagram.

Is UML and sequence diagram same?

The Sequence diagram represents the UML, which is used to visualize the sequence of calls in a system that is used to perform a specific functionality. The Activity diagram represents the UML, which is used to model the workflow of a system. The Sequence diagram shows the message flow from one object to another object.

How do I create a sequence diagram in UML?

Just navigate to the UML Sequence shape library, and click “Use Markup.” A text pad will open, where you can type out the order of your sequence and its rules. When you're ready, click “Build” and click back out into the editor to see your new automatically generated sequence diagram.


3 Answers

What you need to do is describe the functionality of the system enough that you can begin development. That doesn't necessarily mean 1 sequence diagram per use case; it doesn't even mean you have to have any sequence diagrams at all. In fact, I would submit that sequence diagrams belong as definitions of individual method calls, not use cases, but they're only necessary if you're doing a really big design up front, which is usually not a wise thing to do, as you don't always have enough information at design time to define the entire system.

I personally rarely use sequence diagrams; I stick with activity diagrams for use cases and only build a sequence diagram if I actually need to define the flow of a particular method of a particular class, and those only happen if circumstances make it necessary to define at design time.

like image 193
Randolpho Avatar answered Oct 23 '22 08:10

Randolpho


Sequence diagrams are a powerful tool that lets you understand the dynamics of a use case.

I would define "enough" sequence diagrams as the amount of them that lets you understand each use case. If theres a part of a UC that is not been represented, then the one who implements it, may not include it, because he has doubts of because he didn't see the diagram. So i would do the diagrams I feel necessary, and then call some other person involved, show him/her the UC and the Sequence diagrams, and tell him/her to tell me what he/she understood.

Always remember to code / document as if the next guy is a maniac who knows where you live (citation needed)

like image 23
Tom Avatar answered Oct 23 '22 07:10

Tom


Remember that sequence diagrams represent possible interaction scenarios. Therefore, you should draw a different sequence diagram for each relevant scenario. The meaning of "relevant" is up to you. It may be just one if you feel that for a specific use case there is only one relevant scenario (maybe the other scenarios are obvious and are not worth of a specific diagram) or many

like image 39
Jordi Cabot Avatar answered Oct 23 '22 06:10

Jordi Cabot