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

What is the use of activity diagrams and state diagrams in UML behavior diagrams

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

Share

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

Editor to share with you what is the use of activity diagrams and status diagrams in UML behavior diagrams, I believe most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's learn about it!

1. UML activity diagram:

◆ flowcharts are often used to model algorithms.

◆ activity diagrams are similar to flowcharts, except that they support parallel activities.

◆ disadvantages: can not be clearly expressed

Second, the function of UML activity diagram:

1. Describe the work or actions completed during the execution of an operation

2. Describe the internal work of the object

3. Describe the execution of the use case

4. Deal with multithreading

5. Show how to perform a set of related actions and how they affect the surrounding objects

3. UML activity diagrams are not used in the following situations

1. Cooperation between display objects

2. Display the operation of the object during its life cycle.

These two points are accomplished through sequence diagrams and collaboration diagrams.

4. The basic elements of UML activity diagram in UML activity diagram:

◆ activity statu

Transfer between ◆ active states (arrow)

◆ judgment (decision point)

◆ guarantee condition

◆ synchronization bar: synchronization between activities

Start and end points of ◆

There is one and only one starting point, and there can be n endings.

Swimming lanes: used to group activities in the activity diagram and to describe the cooperative relationship between objects.

-the so-called swimming lane technology is to divide the activity line into some vertical areas, which are called swimming lanes.

* State Diagram * *

1. UML state chart:

The state diagram in the ◆ UML behavior diagram describes all possible states of a particular object and the transitions between states caused by the occurrence of various events. For example, the call center system.

◆ state icon

-- status: rectangle (quadrangular arc)

-- transfer

-- starting point

-- end point

1. State machine:

◆ is a behavior that describes the sequence of states experienced by an object or an interaction in response to events during the life cycle.

◆ the behavior of collaboration between a single class or a group of classes can be described by a state machine

◆ A state machine involves some other elements, including states, transitions, and events

2. Status:

A conditional living condition that satisfies certain conditions, performs certain activities, or waits for certain events during the life cycle of an object.

1) name

2) enter collaboration and exit actions

3) Internal conversion

4) Sub-state

5) delay event

3. Transition: a relationship between two states that indicates that an object will perform an action in * states and enter a second state when a particular event occurs and a particular condition is met.

1) Source statu

2) event trigger

3) Guardianship conditions

4) Action

5) Target status

Example: telephone state diagram

Second, the difference between UML activity diagram and state diagram in UML behavior diagram:

Status: results of behavior

Activity: the act of acting.

The icons are different in UML.

Note: in actual projects, activity diagrams are not required.

The situation where the activity diagram is used:

Describe the parallel process or this behavior

Describe an algorithm

Describe an activity that spans multiple use cases

The state diagram in the UML behavior diagram describes the possible states of a specific object and the transitions between them.

Separately, the activity diagram is abstract, but it is not difficult to understand when you make a simple comparison between the activity diagram and the flowchart. We can see it by looking at the example. Swimming lanes are very vivid, and indeed, like swimming lanes, activities are grouped in order to describe the cooperative relationship between objects. The example is easy to understand, but when it comes to concrete implementation, how to group is a problem.

I don't understand the state diagram.

The above is all the content of the article "what is the use of activity diagrams and state diagrams in UML behavior diagrams?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more 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