Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

stateMachine vs Activity

I'm a little confused about difference between state machine diagram and activity diagram in this specific situation. In a follow simple schema, can you distinguish between activity or state machine diagram? The symbols are present in both diagrams. ambiguous diagram

thanks

Mauro

like image 569
Mauro - Italy Avatar asked Nov 05 '16 12:11

Mauro - Italy


2 Answers

I now can confirm that you can't tell. On p. 331 of the UML 2.5 spec you find an example of the receive event used in a SM. The very same symbol is used on p. 409 for an AD.

So the answer is: no, you can't tell which diagram type is being used from the above example.

And more generally (from the Annex on p. 683):

NOTE. This taxonomy provides a logical organization for the various major kinds of diagrams. However, it does not preclude mixing different kinds of diagram types, as one might do when one combines structural and behavioral elements (e.g., showing a state machine nested inside an internal structure). Consequently, the boundaries between the various kinds of diagram types are not strictly enforced.

like image 100
qwerty_so Avatar answered Sep 22 '22 13:09

qwerty_so


No, sometimes (like in a given example) you can't tell based only on shapes. However

  • usually you know upfront which diagram it is so it's not a problem actually
  • the names will be different. States will have nouns while actions/activities as behaviours are named with verbs
  • especially on SM usually there are other elements that make it distinguishable: events triggering, action within states (entry/do/exit), actions run on transitions, SM specific elements like history
  • while signal receipt/send signals are allowed in SM they are hardly ever used
like image 26
Ister Avatar answered Sep 23 '22 13:09

Ister