Difference between StateChart and Activity Diagram

64,000

Solution 1

It might seems so, but the difference is, activity diagrams describe activities and state charts describe states. So those models are orthogonal - you might imagine there is an activity between two states (something that occurs during the transition) and you might say there is a state between two activities. This is rather a simplification, but I think it might suffice to explain the difference, which is primarily focus, both diagrams are for describing behaviours.

Solution 2

An activity diagram is a special case of a state chart diagram in which states are activities (“functions”).
Two types of states:
– Action state:
-- Cannot be decomposed any further.
-- Happens “instantaneously” with respect to the level of abstraction used in the model

– Activity state:
--Can be decomposed further
--The activity is modeled by another activity diagram

For examle an elevator ride.
State chart could contain states such as:
entering, standing still, exit, arrived.

These state transitions are caused by activity diagram events.

And events in activity diagram could be:
Walk in to the elevator, push button to correct floor, walk out of the elevator.

I would say these two diagrams overlaps each other.

Solution 3

Activity diagram is used to document the logic of a single operation/method, a single use case or the flow of logic of a business process. It is equivalent to flowchart and data flow diagram from structured development. The state diagram depict (show)the state of objects as their attributes change from state to the other state. State chart modeling is used to show the sequence of states that an object goes through, the cause the transition from one state to other and the action that result from a state change.

Solution 4

Activity diagram is flow of functions without trigger (event) mechanism, state machine is consist of triggered states.

Share:
64,000
itsaboutcode
Author by

itsaboutcode

Updated on November 22, 2020

Comments

  • itsaboutcode
    itsaboutcode over 3 years

    I am really unable to understand the real difference between these 2 diagrams. I mean both of these deal is "states" but I am not sure what deals with what?

  • Devesh
    Devesh about 10 years
    +1 for great answer, but It would be great if You could elaborate it more with an example and shed more light on it.
  • heltonbiker
    heltonbiker over 9 years
    Worth taking a look, it has nice visual explanation of both diagrams: cs.sjsu.edu/~pearce/modules/lectures/uml/behavior