UML Tutorial for Beginners
Blog containing resources for uml like lecture notes, lecture videos, lab manual, uml diagrams, objective bits, important questions and more.

04/10/2013 Categories: Behavioral Modeling. No Comments on Statechart Diagrams

A statechart diagram shows a state machine, focusing on the flow of control from state to state. A state machine is a behavior that specifies the sequences of states an object goes through during its lifetime in response to events, together with its responses to those events.


Common Properties


A statechart diagram is a special kind of diagram and shares the same common properties as do all other diagrams like a name and graphical contents that are a projection into a model. What distinguishes a state chart diagram from other diagrams is its content.




Statechart diagrams commonly contain:

  • Simple states and composite states
  • Transitions including events and actions


Common Uses


When we model the dynamic aspects of a system, a class or a use case, we will use statechart diagrams in one way:

  • To model reactive (event-driven) objects.


Common Modeling Techniques


Modeling Reactive Objects


To model a reactive object:

  • Choose the context for the state machine, whether it is a class, a use case or the system as a whole.
  • Choose the initial and final states for the object.
  • Decide on the stable states of the object. Start with the high-level states of the object and only then consider its possible substates.
  • Decide on the meaningful partial ordering of stable states over the lifetime of the object.
  • Decide on the events that may trigger a transition from state to state.
  • Attach actions to these transitions and/or to these states.
  • Consider ways to simplify your machine by using substates, branches, forks, joins and history states.
  • Check that all states are reachable under some combination of events.
  • Check that no state is a dead end.
  • Trace through the state machine, either manually or by using tools, to check it against expected sequences of events and their responses.


Consider the following example:



Related Links:

Note: Do you have a question on this article or have a suggestion to make this article better? You can ask or suggest us by filling in the below form. After commenting, your comment will be held for moderation and will be published in 24-48 hrs.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll Up