UML - Sequence Diagram how to show alternate cours

2019-08-27 19:37发布

I've a function called logon(uname,pass) which returns either success or failure message. Should i show this as ALT fragment?

Basically I'm after transforming this use case to sequence diagram:

> main flow:
> 1. User provide username password.
> 2. Display successful message after logon.
> 
> alternate flow:
> 1. User provide invalid username and passsword.
> 2. Display invalid username or passwrod message.

Thanks

标签: uml
2条回答
我命由我不由天
2楼-- · 2019-08-27 20:07

See this example.

Having said that, I'm with @Tanparmaiel in preferring an activity diagram for alternatives: much more visually intuitive.

hth.

查看更多
Emotional °昔
3楼-- · 2019-08-27 20:22

You should use an Activity diagram which depicts the workflow of the action/activities of your application. The sequence diagram shows how the processes interact with one another and in what order.

查看更多
登录 后发表回答