Page 79 - DCAP308_OBJECT_ORIENTED_ANALYSIS_AND_DESIGN
P. 79
Unit 6: State Modelling
State diagrams can also show a superstate for the object. A superstate is used when many Notes
transitions lead to a certain state. Instead of showing all of the transitions from each state to the
redundant state a superstate can be used to show that all of the states inside of the superstate can
transition to the redundant state. This helps make the state diagram easier to read.
Example: Figure 6.18 shows a superstate. Both the Checking and Dispatching states can
transition into the Canceled state, so a transition is shown from a superstate named Active to the
state Cancel. By contrast, the state Dispatching can only transition to the Delivered state, so we
show an arrow only from the Dispatching state to the Delivered state.
Figure 6.18: Superstate
Source: http://www.ddegjust.ac.in/studymaterial/mca-5/mca-503.pdf
Another illustrative example of state diagram is shown below.
Example: Figure 6.19 shows the bank transaction and verification of bank account.
Activities are shown in the state such as do: update account, do: verify card number and do:
verify password. Diagram also shows initial and final states.
Figure 6.19: State Diagram of Bank Transaction and Verification of Bank Account
Source: http://www.ddegjust.ac.in/studymaterial/mca-5/mca-503.pdf
LOVELY PROFESSIONAL UNIVERSITY 73