简体   繁体   English

UML 序列图实现

[英]UML Sequence Diagram Implementation

I have never completed a sequence diagram before and would like to know if my first attempt is correct.我以前从未完成过序列图,想知道我的第一次尝试是否正确。

This sequence diagram is to represent someone modifying a pre-existing scoresheet in a tennis game.此序列图表示有人在网球比赛中修改预先存在的记分表。 This change is added to the database.此更改将添加到数据库中。

在此处输入图像描述

Is this a correct way to model this sequence?这是 model 这个序列的正确方法吗?

Class Diagram For App Class 应用图类图

There are several problems有几个问题

  • You confuse who asks and who does: visibly for you the messages 1, 2 and 3 are actions done by the user, but the notation indicates they are done by ModifyScore for 1 and 3, and by Database for 2.您混淆了谁请求和谁执行:对您来说,消息 1、2 和 3 显然是用户完成的操作,但符号表明它们是由 ModifyScore 完成的 1 和 3,以及由 Database 完成的 2。

  • In your explicit returns (1.2 and 6) you indicate actions, but they can only support the return value(s).在您的显式返回(1.2 和 6)中,您指示操作,但它们只能支持返回值。

  • There is no link between the messages 1, 2 and 3, and the message 2 goes to the Database, and the message 3 has no consequences for the database.消息 1、2 和 3 之间没有链接,消息 2 进入数据库,消息 3 对数据库没有任何影响。 That cannot does what you expect.那不能达到你的预期。

  • It is very difficult to imagine the user asking something to the database很难想象用户向数据库询问某事

Do you have a simplified version of the Java program you try to describe through the a sequence diagram?您是否有您尝试通过序列图描述的 Java 程序的简化版本?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM