我目前正在研究拍卖系统的序列图,该系统充当客户和公司之间的中间人。
然而,我对系统的设计有困难,并会欣赏一些指导,特别是当我寻求收紧UML图时。
系统背后的整个想法是,客户通过移动应用程序创建预订,该应用程序上传到公司可以竞标的拍卖应用程序。如果一家公司中标,拍卖应用程序会给他们一个价格范围,在这个价格范围内,他们可以给客户一个报价(即如果公司A赢得了投标客户X的草坪,那么拍卖应用程序设定的价格范围为$ 15- $ 20对于这份工作,A公司的报价必须在这个范围之间)。然后,客户可以接受报价并继续工作或拒绝。
步骤如下:
1. Customer creates a booking on booking app
1.1 Booking app saves booking (recursive as customer can save more than one
booking)
1.2 Job is uploaded to auction app where other companies can bid for it. In the
next step, a company will bid for job.
In the event of an unsuccessful bid:
2. Company makes bid for job on auction application
2.1 Message sent to company telling them that they failed to win the job
In the event of a successful bid:
3. Company makes bid for job on auction application
3.1 Message sent to company telling them that they won the job
4. Auction app sends price limit message for the job that the company has just
won (to prevent overcharging). In the next step, the company needs to set a
quote
In the event that a customer rejects a set quote
5. Company sets quote for the job that they won
5.1 Auction app sends the quote message to the auction app
6. Quote displayed to customer on mobile application
7. Customer rejects the quote
7.1 The rejection message is sent to the auction app
8. The rejection message is displayed to the company
In the event that a customer accepts a set quote
9. Company sets quote for the job that they won
9.1 Auction app sends the quote message to the auction app
10. Quote displayed to customer on mobile application
11. Customer accepts the quote
11.1 The acceptance message is sent to the auction app
12. The acceptance message is displayed to the company
13. End booking process
这是UML图:
我有3个问题:
BidSuccess=False
(即公司对某项工作的投标失败)时,他们可以选择竞标另一份工作并获胜(因此进入BidSuccess=True
分支)。是否可以在序列图上传达这一点。如果是这样,那怎么样?CustomerAcceptQuote
返回不同的结果。感谢您花时间阅读本文。
答案 0 :(得分:1)
ad 3)对于图表中的loop
/ alt
,其语义不明确,主要是因为它们没有正确嵌套(请参阅{{3例如)
ad 2)至于冗余,您可以使用{/ 3}},如
ad 1,ad 2)总体而言,为了显示分支,同时避免冗余而不是坚持使用UML序列图,您可以使用UML活动图中的功能,如{{3 }}
...交互概述图提供了流的节点是交互或交互使用的控制流的概述。 UML 2.4.1在某些地方的规范将这些图表作为交互图降级,而在其他地方,交互概览图被称为活动图的专业化......
实际上根据http://www.uml-diagrams.org/sequence-diagrams-combined-fragment.html
.. UML规范并不排除混合不同类型的图表,例如结合结构和行为元素来显示嵌套在用例中的状态机。因此,不严格执行各种图之间的界限。同时,某些UML工具限制了可用于处理特定类型图表时可用图形元素的集合。
免责声明:原始图片(没有绿色和紫色矩形)来自Kirill Fakhroutdinov的在线图书UML sequence diagram - interaction use