What is State Machine Diagram

Categories:

Recommended

What is State Machine Diagram?

10-13 minutes

The behavior of an entity is not only a direct consequence of its inputs, but it also depends on its preceding state. The past history of an entity can best be modeled by a finite state machine diagram or traditionally called automata. UML State Machine Diagrams (or sometimes referred to as state diagram, state machine or state chart) show the different states of an entity. State machine diagrams can also show how an entity responds to various events by changing from one state to another. State machine diagram is a UML diagram used to model the dynamic nature of a system.

Are you looking for a Free UML tool for learning UML faster, easier and quicker? Visual Paradigm Community Edition is a UML software that supports all UML diagram types. It is an international award-winning UML modeler, and yet it is easy-to-use, intuitive &completely free.

Free Download

Why State Machine Diagrams?

State machine diagram typically are used to describe state-dependent behavior for an object. An object responds differently to the same event depending on what state it is in . State machine diagrams are usually applied to objects but can be applied to any element that has behavior to other entities such as: actors, use cases, methods, subsystems systems and etc. and they are typically used in conjunction with interaction diagrams (usually sequence diagrams).

For example:

Consider you have $100,000 in a bank account. The behavior of the withdraw function would be: balance := balance – withdraw Amount; provided that the balance after the withdrawal is not less than $0; this is true regardless of how many times you have withdrawn money from the bank. In such situations, the withdrawals do not affect the abstraction of the attribute values, and hence the gross behavior of the object remains unchanged.

However, if the account balance would become negative after a withdrawal , the behavior of the withdraw function would be quite different. This is because the state of the bank account is changed from positive to negative; in technical jargon, a transition from the positive state to the negative state is fired.

The abstraction of the attribute value is a property of the system, rather than a globally applicable rule. For example, if the bank changes the business rule to allow the bank balance to be overdrawn by 2000 dollars, the state of the bank account will be redefined with condition that the balance after withdrawal must not be less than $2000 in deficit.

Category:

VP Flipbook Maker

This flipbooks is made with Visual Paradigm Online. By using this free flipbook maker, you can create flipbooks online for free! You can easily upload PDF documents and convert them into flipbooks.