I have heard people using these terms.
I wonder if they refer to the same thing or is there a difference between these two?
I have heard people using these terms.
I wonder if they refer to the same thing or is there a difference between these two?
Wikipedia actually covers this pretty well. http://en.wikipedia.org/wiki/State_diagram
State machines have been around for a long time (decades at least). They consist of states (usually circles) and arrows between the states where certain actions can trigger an transition along an arrow. Moore and Mealy machines are the two main variants, which indicate whether the output is derived from the transitions or the states themselves.
Statecharts were invented by David Harel, and are sometimes called Harel Statecharts. He defined a pretty broad extension to typical state machines, with the goal of making state machines more useful for actual work with complicated systems.
A variant of Statecharts are build into Matlab now, as stateflow
, which is an extension of simulink. Statesharts are also the basis of the UML "State Machine Diagrams".
Learn more about Stateflow in general at: https://www.mathworks.com/help/stateflow/examples.html
Stateflow has been updated for making it very easy to create state machines and flow charts in R2012b.
The major updates include a new graphical editor, state transition tables, MATLAB as the action language and an integrated debugger.
From the seminal 1999 book "Constructing the User Interface with Statecharts" by Ian Horrocks, published by Addison-Wesley (bold/italicized for emphasis):
From the very nature of user interfaces, it is apparent that states and events are a natural medium for describing their behaviour. Finite state machines are a formal mechanism for collecting and co-ordinating such fragments to form a whole. However, it is generally agreed that, because of the large number of states and events organized in an unstructured way, finite state machines are not appropriate for describing complex systems. The feasibility of a state-based approach for specifying a user interface relies on a specification language that results in diagrams that are concise, well structured, modular and hierarchical.
There are many different notations used to represent finite state machines, such as state transition diagrams and state transition matrices. However, such notations do not address the fundamental problems associated with finite state machines. The statechart notation is not just another notation for a finite state machine; statecharts are a major step forward for state-based notations. They provide a much richer and much more powerful specification language than any finite stale machine notation. All the serious problems associated with finite stale machines are solved by statecharts:
- The number of states in a statechart rises in proportion to the complexity of the system being specified. In finite state machines, the number of states tends to increase rapidly with only a modest increase in the complexity of the system being specified.
- Statecharts avoid duplicate states and duplicate event arrows. This avoids large, chaotic diagrams that are difficult to understand and difficult to modify.
- The states in a statechart have a hierarchical structure, which means the system being modelled can be considered at different levels of abstraction. The modular nature of the states ensures that it is not necessary to understand an entire statechart in order to understand just one part of it. In a nutshell, statecharts are to state transition diagrams what modular decomposition and abstraction are to monolithic code
© 2022 - 2025 — McMap. All rights reserved.