当前位置:网站首页>UML sequence diagram [easy to understand]
UML sequence diagram [easy to understand]
2022-07-04 08:59:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
Concept
Sequence diagram (Sequence Diagram) Describes the time sequence in which messages are delivered between objects , Used to express the order of behavior in use cases , It's an interaction diagram that emphasizes the chronological order of messages . in other words , Sequence diagrams describe classes and messages exchanged between classes to complete the desired behavior .
Content
The sequence diagram includes 4 Elements , They are objects (Object)、 Lifeline (Lifeline)、 Activate (Activation) And news (Message).
- object (Object) The object represents the role of the object in the sequence diagram in the interaction . The symbols of objects in the sequence diagram are the same as those used in the object diagram , Both use rectangles to contain object names , And the object name is underlined , As shown in the figure below :
Placing the object at the top of the sequence diagram means that the object already exists at the beginning of the interaction , If the position of the object is not at the top , Then the representation object is created in the process of interaction ( Objects can be created at the beginning of an interaction , It can also be created during interaction ).
- Lifeline (Lifeline) The lifeline is a vertical dotted line , Indicates the existence of objects in the sequence diagram for a period of time . The bottom center of each object has a lifeline . The lifeline is a timeline , From the top of the sequence diagram to the bottom , The time taken depends on the duration of the interaction . The combination of object and lifeline is called the lifeline of object ; The lifeline of an object contains a rectangular object icon and the lifeline below the icon , As shown in the figure below :
- Activate (Activation) Sequence diagrams can describe the activation of objects (Activation) And deactivation (Deactivation). Activation represents the period during which the object in the sequence diagram performs an operation . Activation means that the object is occupied to complete a task , Deactivation means that the object is idle , Waiting for news . stay UML in , To indicate that the object is active , You can widen the lifeline of an object into a rectangle , As shown in the figure below :
- news (Message) Messages are classes that define the exchange of information in interaction and collaboration , It is used to model the communication content between entities . Messages are used to pass information between entities , Allow entities to request other services , Class roles communicate by sending and receiving messages . It can trigger an operation 、 Evoke a signal or cause the creation or revocation of the target object . Message sequences can be represented by two graphs : Sequence diagrams and collaboration diagrams ( Sequence diagrams emphasize the chronological order of messages , The collaboration diagram emphasizes the relationship between the objects exchanging messages ). stay UML in , Messages are represented by arrows , The type of arrow indicates the type of message , The message arrow refers to the receiving party , As shown in the figure below :
Time series diagram modeling strategy
(1) Set the context of the interaction , These contexts can be systems 、 Subsystem 、 operation 、 class 、 A script for use cases and collaboration ; (2) By identifying the role of the object in the interaction , According to the importance of the object , Place it in the sequence diagram from left to right ; (3) Set the lifeline of each object . In general , Objects exist in the whole process of interaction , But it can also be created and undone during interaction ; (4) Start with the information that triggers an interaction , Draw the following messages from top to bottom between lifelines ; (5) Set the activation period of the object , This can visualize the point in time when the actual calculation occurs 、 Visualize the nesting of messages ; (6) If you need to set time or space constraints , You can attach appropriate time and space constraints to each message ; (7) Attach pre or post conditions to each message of a control flow , This can explain this control flow in more detail .
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/148658.html Link to the original text :https://javaforall.cn
边栏推荐
- 《网络是怎么样连接的》读书笔记 - 集线器、路由器和路由器(三)
- Research Report on research and investment prospects of China's testing machine industry (2022 Edition)
- [Chongqing Guangdong education] National Open University spring 2019 455 logistics practice reference questions
- 【LeetCode 42】501. Mode in binary search tree
- go-zero微服务实战系列(九、极致优化秒杀性能)
- System disk expansion in virtual machine
- Talk about single case mode
- What should I do if there is a problem with the graphics card screen on the computer
- How to pass custom object via intent in kotlin
- How to solve the problem that computers often flash
猜你喜欢

微服务入门:Gateway网关

【LeetCode 42】501. Mode in binary search tree

Codeforces Round #803 (Div. 2)(A-D)

到底什么才是DaaS数据即服务?别再被其他DaaS概念给误导了

User login function: simple but difficult

Developers really review CSDN question and answer function, and there are many improvements~
![Langage C - démarrer - base - syntaxe - [opérateur, conversion de type] (vi)](/img/3f/4d8f4c77d9fde5dd3f53ef890ecfa8.png)
Langage C - démarrer - base - syntaxe - [opérateur, conversion de type] (vi)

转:优秀的管理者,关注的不是错误,而是优势

Guanghetong's high-performance 4g/5g wireless module solution comprehensively promotes an efficient and low-carbon smart grid
![[error record] no matching function for call to 'cacheflush' cacheflush();)](/img/79/c00f9c835606b2dce1d342ec368d24.jpg)
[error record] no matching function for call to 'cacheflush' cacheflush();)
随机推荐
转:优秀的管理者,关注的不是错误,而是优势
[Chongqing Guangdong education] National Open University spring 2019 455 logistics practice reference questions
User login function: simple but difficult
Research Report on the current market situation and development prospects of calcium sulfate whiskers in China (2022 Edition)
Simulate EF dbcontext with MOQ - mocking EF dbcontext with MOQ
Guanghetong's high-performance 4g/5g wireless module solution comprehensively promotes an efficient and low-carbon smart grid
Explain TCP protocol in detail three handshakes and four waves
Manjaro install wechat
Xcode 6 swift code completion does not work properly - Xcode 6 swift code completion not working
如何编写单元测试用例
Webapi interview question summary 01
C language - Introduction - Foundation - syntax - [identifier, keyword, semicolon, space, comment, input and output] (III)
Nurse level JDEC addition, deletion, modification and inspection exercise
AI Winter Olympics | is the future coming? Enter the entrance of the meta universe - virtual digital human
Launpad | 基础知识
Awk from entry to soil (5) simple condition matching
保姆级JDEC增删改查练习
The basic syntax of mermaid in typera
Awk from entry to earth (15) awk executes external commands
Cancel ctrl+alt+delete when starting up