英文:
Can Have Parent Actor more than One Child Actors In Use Case Diagram
问题
在我的用例图中:
Bidder
和 Seller
都继承自 Guest
。这正确吗?还有其他方法吗?
英文:
In my Usecase Diagram :
Bidder
and Seller
both inherit from Guest
. Is this Correct? or is there another way to do it?
答案1
得分: 1
初步的语法备注: UML 使用一个空心三角形的箭头表示继承。小的纯黑色箭头会令人困惑,可能会被误解。
继承的意义: 您的图表表示出投标者和卖家都是客人。这是您想要建模的意思吗?换句话说:
Bidder
和Seller
预计要参与到它们所有关联的用例中,而且还要参与到Guest
的所有用例中吗?如果是的话,那很好!- 但是您是否真的希望一个已经存在的
Bidder
可以注册为Bidder
或者注册为Seller
? - 如果不是的话,考虑关注点分离:区分一个只能注册的
Guest
角色和一个可以登录(但登录真的是一个用例吗?)并执行所有已注册用户都可以执行的常见操作的Registered user
。然后Bidder
和Seller
可以继承自Registered user
。
其他改进:
-
将
Make payment
和Receive notification
关联到Registered user
,因为不允许有相同名称的多个用例。我理解如果卖家进行付款,那可能是平台的费用。 -
添加一个
Pay the auctioned item
,并将其与卖家和投标者都关联,因为有人付款,另一个人收到付款:实际上是同一个用例的两个方面。 -
简化: 用例不应该是要添加到您的软件中的功能,也不应该被分解成函数。它们应该是独立的用户目标(例如,
浏览物品
、筛选物品
和查看物品详细信息
可能是一个更一般用例查看物品
的三个功能)。
英文:
Preliminary syntactical remark: UML shows inheritance with an arrow head that is a hollow triangle. The small plain black arrow heads are confusing and might be misunderstood.
What inheritance means: Your diagram means that a bidder and a seller are both guests. Is this what you mean to model? In other words:
- Are
Bidder
andSeller
expected to be involved in all their associated use-cases, and on top, all the use-cases ofGuest
? If yes, it's fine! - But do you really want that an existing
Bidder
could register asBidder
, or could register asSeller
? - If not, consider separation of concerns: distinguish a
Guest
actor, who could only register, and aRegistered user
who could login (but is login really a use-case?) and do all the common thing that all registered user can do.Bidder
andSeller
could then inherit fromRegistered user
.
Other improvements:
-
associate
Make payment
andReceive notification
toRegistered user
, because you're not allowed to have several use-cases with the same name. I understand that if the seller makes payment, it's probably the fee for the platform. -
have a
Pay the auctioned item
and associate it to both the seller and the bidder, because one pays, and the other receives the payment : it's in fact two sides of the same use-case. -
simplify: use-cases should not be features to add to your software, nor functions to be decompsed. It should be independent user-goals (e.g.
Browse items
,filter items
andview item details
are probably three features of one more general use-caseView items
)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论