UML Elements: State Diagram
The state diagram is used as a symbol for finite state machines. It may also be used to represent state transition tables. Of the 13 diagrams available in UML 2.0, the state diagram has some of the most variations. In addition to coming in different forms, it may also use various types of semantics. The traditional form that is used for the state diagram is the directed graph.
The directed graph may come with a number of different elements, and some of these are States Q, Input symbols, Output symbols Z, Edges, Start state qo, and Accepting state(s) F. The States Q is a finite coupling of vertices that will normally be symbolized by circles, and it may also be labeled with a special designation symbol. Words may also be written inside it. The Input symbols are a finite group of input symbols that may also be designators. For example, if you’re dealing with a Moore machine, or a deterministic finite state machine, the input may be defined on every edge, and this will typically be near the first state.
Output symbols Z is a finite group of symbols or designators that are used for output. If you are working with a Mealy machine, both the input and output will be defined by every edge. If you are working with a Moore machine, the state of the output will generally be written within the circle of the state, and it may be split from the designator of the state with a slash symbol "/". The Edges will be used to symbolize the transitions that occur between two states caused by the input. They will be identified by their symbols which are drawn on the edges. An edge will generally be drawn as an arrow that points from the present state in the direction of another state.
Start State qo and Accepting state(s) F
The start state qo will generally be represented by the arrow which will "point to it from nowhere." It must be noted that the start state will not be shown, and it will need to be defined from the text. The Accepting state(s) F is a group of double circles which will be used to define accept states. In some cases, the accept state(s) will function as the "Final" states. Below are some examples which further explain this diagram and the elements which comprise it. If you’re working with a Moore machine, every edge will be labeled along with the input. When you work with a Moore machine, you may be presented with both accept states and states.
If you’re working with a Mealy machine, the edge may be labeled in various ways, and you will have both input and output. The labels for each edge may vary depending on the situation. Another concept that you will want to become familiar with is the Harel statechart. These charts were created by David Harel in the 1980s, and they have become quite popular since they were added to the Unified Modeling Language.
This diagram allows for the existence of model superstates, and it also supports concurrent state diagrams. The goal is to model activities in a way that makes them connected to the state. When you work with classic state diagrams, the machine will only be allowed to exist in one state.
When you use Harel statecharts, it will be possible to model the "and" machines, and this will allow the machine to exist in two states simultaneously. One reason this works is due to the modeling of the superstate, as well as the modeling of the concurrent machines. The UML state diagram is another important element that you will need to know. It is one of the many diagrams which make up UML 2.0, and it is closely connected to the Harel statechart in a number of novel ways. Understanding the importance of the state diagram is crucial in the function of the Unified Modeling Language.
State Diagram Explained
The state diagram is basically a Harel statechart that uses a standard notation. It can be used to describe a number of things, and this includes business processes as well as computer applications.
There are a number of notational elements which make up this diagram, and these are the filled circle, the hollow circle, the rounded rectangle, the arrow, and the thick horizontal line. The filled circle may be used to point to the initial state. The hollow circle may contain a smaller circle which is filled, and this will indicate the final state is there is any. The rounded rectangle will be used to define a state. The top of this rectangle will have the name of this state, and it may have a horizontal line in its center.
Below the horizontal line at the center, activities which are done in the state may be listed. The arrow will be used to represent a transition. The name of an event may be listed, and a guard expression may also be used. If the guard expression is used, it will be enclosed within brackets. When this is done, it means that the expression will be true if the transition is to occur. If any action is carried out during this transition, it may be labeled with the "/" symbol. A thick horizontal line with a "1" or "x>1" lines will be used to represent either a join or a fork.
Another concept that you may frequently encounter in UML are extensions. One thing that many developers do is allow the arcs to flow from a certain number of states to another group of states. This will only be useful in situations where the system is allowed to be in various states simultaneously, and this implies that the individual states will only define a condition or another part of the global state.
This formulation is known as the Petri net. There are additional extensions which will allow you to integrate your flowcharts inside the Harel state charts. When you use this extension, you can develop software that is driven by both events and workflow.
Conclusion
Diagrams are an important part of the Unified Modeling Language, and they have been fully utilized by the many developers who use this language. The introduction of Harel statecharts has made things easier, and now elements are allowed to exist in multiple states at the same time.
This combination is expected to increase the efficiency of UML, and this will allow it to be more powerful for developers who wish to design high end applications. If you’re working remotely, and you need a powerful language that is robust and flexible, UML is something that you will want to take a look at.