序列图示例 [英] Sequence diagram example

查看:39
本文介绍了序列图示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要建模的用例是新约会的注册.

The use case to model is the register of a new appointment.

用户以患者(角色)身份登录系统.预约时应输入医学专业和日期.系统应在该日期查找该专业的可用医生.从结果患者应该选择一个然后系统保存约会.最终用户应该会收到一封包含约会信息的电子邮件.

The user logins in the system as a patient (role). To make an appointment shoudl enter medical specialty and date. System shoudl look for the doctors availables for that specialty on that date. From the results patient should choose one and then system save the appointment. At the end user shoudl receive an email with the information of the appointment.

我的模型中的类是:用户病人医生预约医生时间表还有一些,但我认为这些会涉及.

The classes that I have in my model are: User PAtient Doctor Appointment DoctorShcedule and some more but I think these ones will be involve.

我有这个初始序列图:

我在设置返回消息和电子邮件步骤时遇到问题.

I have problem to set the return messages and also with the email step.

谢谢

推荐答案

I have problem to set the return messages and also with the email step.

返回消息有两种表示法,要么像响应 checkAvailability() 那样发送返回消息,要么在被调用的方法后面写入返回值或对象,例如checkAvailability() : bool .

There two notations for return messages either by sending a return message as you did in response to checkAvailability() or by writing the returned value or object behind the called method i.g. checkAvailability() : bool .

发送邮件是一种异步操作,邮件会离开您的系统.我建议引入另一个类 Mailer,它应该处理 sendMail() 消息而不是您的类用户.稍后接收邮件是另一个用例,此邮件的接收不属于此序列图(恕我直言).

Sending a mail is an asynchonous operation and the mail leaves your system. I would suggest to introduce another class Mailer which should process the sendMail() message instead of your class user. Receiving the mail later is another use case and receiption of this mail doesn't belong into this sequence diagramm (IMHO).

这篇关于序列图示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆