
Modeling Solutions ◾ 183
transition to the Next state occurs. Entering transitions must connect to
inner states, not outer states.
Figure6.17 also points out that it is possible for either inner or outer
states to include their own entry, exit, and do actions. When an outer state
has actions, these must apply to all of its inner states. For example, the do
action of the Playing state means that songs continue to play regardless of
whether in the Louder, Normal, or Quieter states.
6.8 SUMMARY
Although their focus is somewhat dierent, both activity diagrams and
state diagrams are eective ways to picture and to design algorithms. Both ...