Sequence diagram example

2019-06-14 02:15发布

问题:

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 this initial sequnce diagram:

diagram http://img697.imageshack.us/img697/2416/newapp.jpg

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

Thanks

回答1:

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

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 .

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).