Page 71 - DCAP308_OBJECT_ORIENTED_ANALYSIS_AND_DESIGN
P. 71
Unit 6: State Modelling
the object through the entire system. Not all classes will require a state diagram and state Notes
diagrams are not useful for describing the collaboration of all objects in a use case.
Notes State diagrams are combined with other diagrams such as interaction diagrams
and activity diagrams.
6.2.2 How to draw State Diagrams
State diagrams have very few elements. The basic elements are rounded boxes representing the
state of the object and arrows indicting the transition to the next state. The activity section of the
state symbol depicts what activities the object will be doing while it is in that state as shown
Figure 6.1 below.
Figure 6.1: Activity Section
Source: http://www.ddegjust.ac.in/studymaterial/mca-5/mca-503.pdf
Initial and Final States: All state diagrams being with an initial state of the object as shown in
Figure 6.2. This is the state of the object when it is created. After the initial state the object begins
changing states. Conditions based on the activities can determine what the next state the object
transitions to.
Figure 6.2: Initial State
Source: http://www.ddegjust.ac.in/studymaterial/mca-5/mca-503.pdf
The initial state is denoted by a filled black circle and may be labeled with a name. The final state
is denoted by a circle with a dot inside and may also be labeled with a name as shown in Figure
6.3.
LOVELY PROFESSIONAL UNIVERSITY 65