UML 用例:组中特定参与者的表示
假设我有 2 个组,由 2 个子组组成。每个小组由 2 名演员组成。
我如何在 UML 用例中表示这个参与者是特定子组的成员,而该子组又是更大组的一部分?
Lets say that I have 2 groups consisted of 2 sub-groups. Each sub-group is consisted of 2 actors.
How can I represent in a UML use-case this actor who is member of a specific sub-group which is part of a bigger group?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么需要识别特定个人?请记住,演员代表个人扮演的角色,而不是个人本身。用一个简单的编程类比来说,Actor 就像类,个体就像对象。
如果您想表示 Actor(角色)之间的子集关系,那么您可以使用子类型关系,例如
所以
高级会员
也是会员
,反过来也是用户
。但并非所有用户
都是会员
,也并非所有会员
都是高级会员
。现在,达到这个水平是否是一个好主意是一个完全不同的问题。明智的使用可能会有所帮助,但扩展的 Actor 层次结构却很少有帮助。
嗯。
Why do you need to identify a specific individual? Remember Actors represent Roles played by individuals, not the individuals themselves. To use a simple programming analogy, Actors are like classes, individuals are like objects.
If instead you want to represent subset relations among Actors (Roles) then you can use the subtype relation, e.g.
So
Premium Members
are alsoMembers
and in turn alsoUsers
. But not allUsers
areMembers
, and not allMembers
arePremium Members
.Now whether going to that level is a good idea is an entirely different question. Judicious use can be helpful, but expansive Actor hierarchies rarely are.
hth.