When drawing state diagrams, how do you know which states get put in boxes and which states are for the transition arrows? I noticed that transitions are states too.
I'm looking at figure 1 on this page:
Steps to draw a state diagram –Identify the initial state and the final terminating states. Identify the possible states in which the object can exist (boundary values corresponding to different attributes guide us in identifying different states). Label the events which trigger these transitions.
A state diagram, sometimes known as a state machine diagram, is a type of behavioral diagram in the Unified Modeling Language (UML) that shows transitions between various objects.
A state diagram shows the behavior of classes in response to external stimuli. Specifically a state diagram describes the behavior of a single object in response to a series of events in a system. Sometimes it's also known as a Harel state chart or a state machine diagram.
Transitions are NOT states. Transitions are the events that move an object from one state to the next. States are defined by the value of variables in the object and by the behaviour of the object. Take for instance a Student object that has a value "new-waiting for approval" value. That student is not allowed to register for or attend classes. But the same student may be allowed to register for and attend classes if the value changes to "approved". What's the difference? The student object actually has two states.
What causes the Student object to move from one state to the next? The event "Approval Arrives" maybe. So Approval Arrives go on the arrow between two states.
'Transition arrows' in the diagram are not states, they are "TRANSITION/ACTION/HAPPENING". For e.g. in the mentioned figure, "Scheduled" is the state, open is action after which it goes to "Open for enrollment" state. This "open" transition can be replaced more verbose with "is being opened" Unfortunately, the transition actions like scheduled/open are very easily confused for a state as well, but that is not the intent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With