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)

    • nasir
    • March 23rd, 2010

    “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.

    • Modenas128GT
    • March 23rd, 2010

    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.

    • Modenas128GT
    • March 23rd, 2010

    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.

    • Modenas128GT
    • March 23rd, 2010
    • Modenas128GT
    • March 23rd, 2010
    • Jagtap Prajakta
    • October 16th, 2014

    Explain difference between state and activity

  1. 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!

    • potatoman
    • August 18th, 2017

    SM can have a choice

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: