UML State Machine DiagramsAltova UModel® 2012 makes it easy to identify states and transitions of an object as it proceeds through its life cycle.
UML state machine diagrams describe the behavior of a class over time through illustrations of the states and transitions of a single object progressing through its lifetime. State machine diagrams are a traditional object-oriented way to show behavior and to document how an object responds to events, including internal and external stimuli.
You can even acecelerate your project by generating a complete executable source code project in Java, C#, or Visual Basic from your UModel state machine diagram.
Altova UModel Features OverviewAltova UModel® 2012 is an intuitive, affordable, and fully featured tool to create UML state machine diagrams along with the other advantages of UML-based software development. UModel supports these advanced features:
Drawing State Machine DiagramsThe UModel® 2012 state machine diagram toolbar brings together all the UML 2 elements you’ll need for your state machines.
This special toolbar helps avoid confusion as you draw your diagram, since state machines share some – but not all – of the same UML element symbols used in activity diagrams.
Next, you may want to create a new transition from one state to another. UModel automatically connects the states with the shortest possible line.
Note that the new transition arrow remains selected after you connect the states. The new transition arrow has three small icons called waypoints that can be used to alter the line characteristics and the layout toolbar alerts you of the line style that is currently selected.
You can simply grab the line with your cursor and drag it to shape the path you want.
The new transition arrow in this example needs a guard, a Boolean statement to indicate an event or condition that will allow the transition to proceed. Without a guard, the new arrow indicates that the dehumidifier stops when the tank is full, then immediately proceeds to the sensing state. But what if humidity is still high? The circuit will turn on again and the tank will overflow.
Guard text requires brackets, which UModel provides automatically. You can select the guard in the drawing pane and move it wherever you like. You can edit the text in the Properties window or directly in the design pane if you wish.
The dehumidifier example needs one more piece of logic. Consider what would happen if the room’s humidity is neither above nor below, but exactly at the critical detection level. To prevent overloading the circuits by repeatedly turning the system on/off, on/off, on/off, likely, the simplest and most cost-effective remedy would be to add a delay to the transition out of the sensing state.
After you enter the text you can move it wherever you like, and the revisions to the state machine diagram in this example are complete.
Creating Operations from TransitionsWhen you add a new transition to a state machine diagram that is inside a class or interface, you may assign a message name or use the operation pull-down list in the Properties helper window to assign an existing operation from the target class. If you turn on Automatic Creation of Operations in the State Machine Diagram toolbar, you can create a new operation in the target class by typing the new operation in the transition in your communication diagram.
Composite State Machine Diagrams
If your own project is more complex than a single dehumidifier control, you’ll find the UModel® 2012 elements for composite states, orthogonal states, and submachine states as easy to place and manipulate as simple states.
Click image to enlarge screenshot Generate Code from State Machine DiagramsUModel® 2012 lets you generate code from state machine diagrams that is fully executable, so you can quickly begin testing the logic captured in your state machine diagram. You can generate code either as part of the normal project code generation process, via a selection in the Project menu, or directly from the state machine diagram context menu.
The context menu also provides an option to let you check the state machine diagram syntax, to avoid generating code that is not valid. The Generate State Machine Code dialog box lets you control code generation settings, and even specify whether state machine code is automatically regenerated with project code generation.
The UModel® 2012 examples even include Visual Studio solution files for C# and Visual Basic, and a Java tester application that demonstrates execution of the state machine code and is easily adaptable to use with your own state machine diagrams.
Automatic Update of State Machine CodeEvery development project goes through multiple iterations. UModel offers convenient features to manage generation of state machine code as your project progresses:
Protocol State Machine DiagramsProtocol state machines are a variation of state machine diagrams most often used to describe complex protocols, such as database access through a specific interface, or communication protocols such as TCP/IP. UModel supports protocol state machine diagrams as a unique diagram type with a specialized diagram toolbar. Click here to read more about support for protocol state machine diagrams. in UModel® 2012. SysML State DiagramsUModel also supports SysML state diagrams, which extend UML activity diagrams by adding the SysML allocate element. Click here to read more about support for SysML in UModel® 2012. See for yourself how easy it is to create UML 2 state machine diagrams with UModel® 2012!
|
| ||||||||||||||||||||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
