views:

171

answers:

3

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:

UML 2 State Machine Diagrams

+1  A: 

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.

Vincent Ramdhanie
+2  A: 

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

Ranz
A: 

Could you say that if you have an object which existence has to be verify before creation. Created would be the state and verification would be the transition arrow?

Milena

related questions