Drawing UML state diagrams

2.2k views Asked by At

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:

enter image description here

4

There are 4 answers

1
Vincent Ramdhanie On

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.

0
Ranz On

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

0
granier On

I agree of one point, in specification , on some example, transitions looks like state. state diagrame

For me "selectAmount" is not exactly a state name ...

0
dulaj sanjaya On

At first you need to identify objects in your system. Among those objects, You need to select objects which have probability of change over the time.Then You need to draw state diagrams for all those selected objects separately.Boxes represent the states of that object and arrow represents the activity which causes to change the state of particular object.