State vs Activity Diagram
State Diagram
Activity Diagram
So, what is the difference?
Activity Diagram |
State Diagram |
|
Has Swimlane |
Has no swimlane |
|
Can have decision node (diamond IF) |
Can’t has decision node |
|
Square = invocation |
Circle = current system’s state |
|
Has no trigger |
Has trigger (arrow’s label) |
|
Note that, trigger in state diagram is invocation in activity diagram. |
||
Start with active verb. |
Normal statement. |
|
Shows what activity is done by the actor |
Shows the consequence of the trigger (activity/invocation in activity diagram) |
“state diagram ni pasal consequences bubble aktiviti dalam aktiviti diagram , pastu ada sekali trigger sebelum aktiviti tu tamat”
sambil baca ni leh rujuk diagram atas.
So basically, kita kena buat activity diagram dulu. Dari situ, setiap invocation (dlm kotak2 biru) tu, jadikan trigger kat state diagram.
triger tu adalah arrow yg menghubungkan buble dlm state diagram. Label trigger tu adalah isi kotak (invocation) dlm activity diagram.
Bubble dlm state diagram plak, di isi dengan “what will happen after this trigger executed”.
contohnya, kalau triger (which is also isi dlm kotak activity diagram) = customer MAKE PAYMENT, consequence dari customer make payment ini adalah… PAYMENT RECEIVED.
So, MAKE PAYMENT tu adalah trigger, dan PAYMENT RECEIVED adalah state.
A state machine is idle when it sits in a state waiting for an event to occur. A flowchart is busy executing activities when it sits in a node. The figure above attempts to show that reversal of roles by aligning the arcs of the state diagrams with the processing stages of the flowchart.
You can compare a flowchart to an assembly line in manufacturing because the flowchart describes the progression of some task from beginning to end (e.g., transforming source code input into object code output by a compiler). A state machine generally has no notion of such a progression. The door state machine shown at the top of this article, for example, is not in a more advanced stage when it is in the “closed” state, compared to being in the “opened” state; it simply reacts differently to the open/close events. A state in a state machine is an efficient way of specifying a particular behavior, rather than a stage of processing.
The distinction between state machines and flowcharts is especially important because these two concepts represent two diametrically opposed programming paradigms: event-driven programming (state diagrams) and structured programming (flowcharts). You cannot devise effective UML state machines without constantly thinking about the available events. In contrast, events are only a secondary concern (if at all) for flowcharts.
http://www.developer.com/design/article.php/2238131/State-Diagram-in-UML.htm
http://atlas.kennesaw.edu/~dbraun/csis4650/A&D/UML_tutorial/state.htm
Explain difference between state and activity
Hello! I could have sworn I’ve been to this site before but after browsing through some of
the articles I realized it’s new to me. Anyhow, I’m certainly happy I discovered it and I’ll be book-marking it
and checking back regularly!
SM can have a choice