Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use UML state machine view

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to use the UML state machine view, the introduction in the article is very detailed, has a certain reference value, interested friends must finish!

Overview of UML state machine view

The UML state machine view describes the dynamic behavior of class objects over time by modeling the life cycle of class objects. Each object is seen as an independent entity that communicates with the rest of the outside world by detecting and responding to events. An event represents a change in motion of something that an object can detect-such as receiving a call or signal from one object to another, a change in certain values, or the end of a period of time. Anything that affects an object can be an event, and a model of what happens in the real world is built by signals from the outside world to the system.

A state is a set of property values of an object of a given class that respond in the same way to events that occur. In other words, objects in the same state react to the same event in the same way, so when multiple objects in a given state receive the same event, they will perform the same action. However, objects in different states will react differently to the same event through different actions. For example, when the answering machine is in a transactional or idle state, it reacts differently to the cancel key.

State machines are used to describe the behavior of classes, but they also describe the dynamic behavior of use cases, collaborations, and methods. For these object aspects, a state represents a step in execution. We usually use classes and objects to describe the state machine, but it can also be applied directly by other elements.

State machine

A state machine is a diagram that shows states and state transitions. Usually a state machine is attached to a class and describes how an instance of a class reacts to the events it receives. State machines can also be attached to operations, use cases, and collaborations and describe their execution.

A state machine is a model of all possible life processes of an object of a class. Objects are extracted and examined in isolation from the system, and any external influence is summarized as an event. When an object detects an event, it reacts according to its current state, including performing an action and transitioning to a new state. State machines can be constructed as inheritance transformations, or they can be modeled for co-distribution.

A state machine is a partial view of an object, a graph that separates an object from its external world and examines its behavior independently. The state machine can be used to describe the behavior accurately, but it is not suitable to comprehensively understand the operation of the system. Interactive views are more useful if you want to better understand the impact of system-wide behavior. However, state machines help to understand controllers such as user interfaces and device controllers.

UML state machine view composition state

A simple state has no substructure, only a set of transitions and possible entry and exit actions. A constituent state is a state that is broken down into sequential or concurrent substates.

Decomposing states into mutually exclusive sub-states is a specialized treatment of states. An external state is subdivided into multiple internal sub-states, each of which inherits the transition of the external state. Only one sub-state is active at a time. The external state expresses the conditions that each internal state has.

Entering or leaving a transition from a constituent state can lead to the execution of an entry action or an exit action. If there are multiple component states, transitions across multiple levels will result in the execution of multiple entry actions (outermost * * execution) and exit actions (innermost * * execution). If the conversion has an action, the action is performed after the entry action and before the exit action.

The constituent state of the UML state machine view may also have an initial state within it. The transition on the constituent state boundary is implied as the transition on the initial state. A new object starts in its outermost initial state. If an object reaches the termination state of its outermost state, the object is destroyed. Initial state, termination state, entry action and exit action encapsulate the definition of state, so that the definition of state has nothing to do with the transition of in and out state.

Decomposing a state into concurrent sub-states represents independent parallel processing. When entering a concurrent hyper-state, the number of control threads increases; when leaving a concurrent hyper-state, the number of control threads decreases. For each state, concurrency is usually implemented by different objects, but concurrent sub-states can also represent logical concurrency relationships within a single state.

In general, you can use part of another state machine in one state machine, and this reusability brings some convenience. State machines can be named and can refer to one or more other state machines by name. The target state machine is a sub-machine, and the state referencing this sub-machine is called the sub-machine reference state. It means to replace the original content with a state machine where a reference is needed. A state machine can contain an activity, that is, it can contain a process or a continuous process that takes time to complete, or an event that can be interrupted, while a sub-machine cannot. Figure 6-7 illustrates a reference to a sub-machine.

A transition into a sub-machine reference state activates the initial state of the target sub-machine. To enter a sub-machine in another state, you need to place one or more pile states in the sub-machine reference state. The pile state is used to identify the status in the child machine.

The above is all the contents of the article "how to use UML State Machine View". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report