简体   繁体   中英

How to show “OR” statement in sequence diagram?

When drawing a sequence diagram , I saw that I need to implement an "OR" statement.Such as,

CUSTOMER can pay the bill to either WAITER or CASHIER.

Now,I have a paidBill() function which can pay either waiter or cashier. Please help to draw this.

This is not really "OR", because that would imply that you can pay both Waiter and Cashier at the same time ("OR" is one, the other, or both). So what you want instead is if/else. This is denoted by combined fragments.

在此处输入图片说明

Exact same answer with Peter except "paidBill() function" showing on the diagram.

顺序图

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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