Page 83 - DCAP308_OBJECT_ORIENTED_ANALYSIS_AND_DESIGN
P. 83

Unit 6: State Modelling




          6.3 Summary                                                                           Notes

               An event is the specification of a significant occurrence. For a state machine, an event is the
               occurrence of a stimulus that can trigger a state transition.

               A state is a condition during the life of an object during which it satisfies some condition,
               performs some activity, or waits for some external event.

               A transition is a relationship between two states indicating that an object in the first state
               will, when a specified set of events and conditions are satisfied, perform certain actions
               and enter the second state.
               A condition is a Boolean function of object values. A condition is valid over an interval of
               time.

               Activity includes continuous operations such as displaying a picture on a television screen
               as well as sequential operations that terminate by themselves after an interval of time
               such as closing a valve or performing a computation.

               State diagrams are used to describe the behavior of a system. State diagrams describe all
               of the possible states of an object as events occur.

               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.
               State diagrams are used to demonstrate the behavior of an object through many use cases
               of the system.

          6.4 Keywords

          Action: An action is an executable, atomic (with reference to the state machine) computation.
          Activity: Activity is an operation that takes time to complete.
          Condition: A condition is a Boolean function of object values.

          Event: An event is the specification of a significant occurrence.
          State diagrams: State diagrams describe all of the possible states of an object as events occur.
          State machine: A state machine is a behavior which specifies the sequence of states an object
          visits during its lifetime in response to events, together with its responses to those events.
          State: A state is a condition during the life of an object during which it satisfies some condition,
          performs some activity, or waits for some external event.

          Transition: A transition is a relationship between two states indicating that an object in the first
          state will, when a specified set of events and conditions are satisfied, perform certain actions and
          enter the second state.

          6.5 Review Questions

          1.   Illustrate the concept of events and states with example.
          2.   Make distinction between transition and condition.
          3.   What are state diagrams? Illustrate the use of state diagrams.

          4.   Elucidate the concept of initial and final states in the state diagram.
          5.   What are state actions? Illustrate with example.



                                           LOVELY PROFESSIONAL UNIVERSITY                                   77
   78   79   80   81   82   83   84   85   86   87   88