在用例图中,父参与者是否可以有多个子参与者?

huangapple go评论52阅读模式
英文:

Can Have Parent Actor more than One Child Actors In Use Case Diagram

问题

在我的用例图中:

BidderSeller 都继承自 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 使用一个空心三角形的箭头表示继承。小的纯黑色箭头会令人困惑,可能会被误解。

继承的意义: 您的图表表示出投标者和卖家都是客人。这是您想要建模的意思吗?换句话说:

  • BidderSeller 预计要参与到它们所有关联的用例中,而且还要参与到 Guest 的所有用例中吗?如果是的话,那很好!
  • 但是您是否真的希望一个已经存在的 Bidder 可以注册为 Bidder 或者注册为 Seller
  • 如果不是的话,考虑关注点分离:区分一个只能注册的 Guest 角色和一个可以登录(但登录真的是一个用例吗?)并执行所有已注册用户都可以执行的常见操作的 Registered user。然后 BidderSeller 可以继承自 Registered user

其他改进

  • Make paymentReceive 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 and Seller expected to be involved in all their associated use-cases, and on top, all the use-cases of Guest? If yes, it's fine!
  • But do you really want that an existing Bidder could register as Bidder, or could register as Seller?
  • If not, consider separation of concerns: distinguish a Guest actor, who could only register, and a Registered user who could login (but is login really a use-case?) and do all the common thing that all registered user can do. Bidder and Seller could then inherit from Registered user.

Other improvements:

  • associate Make payment and Receive notification to Registered 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 and view item details are probably three features of one more general use-case View items)

huangapple
  • 本文由 发表于 2023年4月19日 23:56:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/76056567.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定