Page 72 - DCAP308_OBJECT_ORIENTED_ANALYSIS_AND_DESIGN
P. 72

Object Oriented Analysis and Design




                    Notes
                                                                Figure 6.3: Final State











                                   Source:  http://www.ddegjust.ac.in/studymaterial/mca-5/mca-503.pdf
                                   Transitions: Transitions from one state to the next are denoted by lines with arrowheads. A
                                   transition may have a trigger, a guard and an effect, as shown in Figure 6.4 below.

                                                                Figure 6.4: Transitions










                                   Source: http://www.ddegjust.ac.in/studymaterial/mca-5/mca-503.pdf
                                   “Trigger” is the cause of the transition, which could be a signal, an event, a change in some
                                   condition, or the passage of time.




                                     Notes “Guard” is a condition which must be true in order for the trigger to cause the
                                     transition. “Effect” is an action which will be invoked directly on the object that owns the
                                     state machine as a result of the transition.

                                   State Actions: In the transition example above, an effect was associated with the transition. If the
                                   target state had many transitions arriving at it, and each transition had the same effect associated
                                   with it, it would be better to associate the effect with the target state rather than the transitions.
                                   This can be done by defining an entry action for the state.


                                          Example: The diagram in Figure 6.5 below shows a state with an entry action and an exit
                                   action

                                                  Figure 6.5: State with an Entry  Action and an  Exit Action











                                   Source:  http://www.ddegjust.ac.in/studymaterial/mca-5/mca-503.pdf
                                   It is also possible to define actions that occur on events, or actions that always occur.





          66                                LOVELY PROFESSIONAL UNIVERSITY
   67   68   69   70   71   72   73   74   75   76   77