1 / 20

Advanced UML State Diagrams

Advanced UML State Diagrams. Objectives. To present advanced features of the UML state diagram notation To illustrate uses of state diagrams with advanced features To present heuristics for making good state diagrams with advanced features. Topics. Concurrent composite states

usoa
Télécharger la présentation

Advanced UML State Diagrams

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Advanced UML State Diagrams

  2. Objectives • To present advanced features of the UML state diagram notation • To illustrate uses of state diagrams with advanced features • To present heuristics for making good state diagrams with advanced features

  3. Topics • Concurrent composite states • Compound transitions • History and deep history states • More state diagram heuristics

  4. Concurrent Composite States • The regions in a concurrent composite state nested state compartment contain state diagrams that execute in parallel. • One state in each region is entered when the concurrent composite state is entered. • One state from each region is always among the joint concurrent states until the concurrent composite state is exited. • Events cause transitions in each concurrent region to occur simultaneously.

  5. Concurrent Composite State Example

  6. Entering Concurrent Composite States • Make a transition to the concurrent composite state boundary • The initial state in each region becomes the current state • Make a transition to individual states in different regions • Main transition goes to a fork bar • Transitions to individual state come from the fork bar • A region without a state targeted by a transition begins in its initial state

  7. Entering Selected Concurrent States: Illustration

  8. Leaving Concurrent Composite States • Make a transition from the concurrent composite state boundary • For a non-completion transition, all concurrent sub-states are exited immediately • For a completion transition, the current state must be a final state in every concurrent region • Make a transition from one or more concurrent sub-states • Coordinated transitions can go to a join bar • All other sub-states are exited immediately

  9. Leaving Selected Concurrent States: Illustration

  10. Using Concurrent Composite States • Any concurrent composite state can be represented by a diagram with only simple states, but it will have many more states than the concurrent composite state. • Concurrent composite states thus simplify diagrams. • On the other hand, diagrams with concurrent composite states are often hard to understand.

  11. Compound Transitions • Transitions from multiple sources or to multiple targets with common transition strings • Transition arrows from multiple sources may converge on a transition junction point from which a single arrow goes to a target • Common transition string stated only once • A transition arrows with a single event string may end at a junction point from which emerge arrows with mutually exclusive guards to multiple targets • Symbol is a filled circle

  12. Compound Transition Example

  13. History States • A history state is a pseudo-state indicating that the sub-state last active when a composite state was exited should be reentered. • Symbol is a circled H • Many common devices have persistent state, so this is a useful modeling feature.

  14. History State Example

  15. History State Restrictions • May only appear in a region of a composite state • Transitions may only enter a history state from outside the composite state • May have at most one unlabeled outgoing transition to a peer state • Indicates the default reentered state if the composite state has not yet been entered • History states may not have internal transitions, nested compartments, etc. • History state is forgotten if the current inner state becomes a final state.

  16. Deep History States • A history state indicates reentry to a state at the same nesting level. • States at lower nesting levels are entered as usual (initial states). • A deep history state is a pseudo-state indicating that the states last active at every nesting level when a composite state was exited should be reentered. • Symbol is a circled H*

  17. Deep History State Example

  18. More State Diagram Heuristics 1 • Avoid concurrent composite states, especially those with synch states. • Designate an initial state in every concurrent region of a concurrent composite state. • Check that transitions to several concurrent sub-states go through a fork.

  19. More State Diagram Heuristics 2 • Check that arrows connected to transition junction points are properly labeled. • Check that at most one unlabeled arrow emanates from each history state. • Check that every sequential state diagram containing a history state has an initial state.

  20. Summary • State diagrams can show concurrency concurrent composite states, but these are governed by somewhat complex rules and hard sometimes hard to understand. • Compound transitions allow combination of several transitions with common transition strings into one. • History and deep history states allow state diagrams to model persistent states.

More Related