Page 77 - DCAP308_OBJECT_ORIENTED_ANALYSIS_AND_DESIGN
P. 77

Unit 6: State Modelling




          If there is a power cut, the washing machine will stop running and will go to the “Power Off”  Notes
          state. Then when the power is restored, the Running state is entered at the “History State”
          symbol meaning that it should resume where it last left-off.
                                   Figure 6.14: Use of History States





















          Source: http://www.ddegjust.ac.in/studymaterial/mca-5/mca-503.pdf
          Concurrent Regions: A state may be divided into regions containing substates that exist and
          execute concurrently.


                 Example: Figure 6.15 shows that within the state “Applying Brakes”, the front and rear
          brakes will be operating simultaneously and independently. Notice the use of fork and join
          pseudo-states, rather than choice and merge pseudo-states. These symbols are used to synchronize
          the concurrent threads.
                                Figure 6.15: Concurrent Regions  Example





















          Source:  http://www.ddegjust.ac.in/studymaterial/mca-5/mca-503.pdf
          A state machine diagram models the behavior of a single object, specifying the sequence of
          events that an object goes through during its lifetime in response to events.


                 Example: The following state machine in Figure 6.16 shows the states that a door goes
          through during its lifetime.






                                           LOVELY PROFESSIONAL UNIVERSITY                                   71
   72   73   74   75   76   77   78   79   80   81   82