简体   繁体   English

当一个参与者可以更改另一个参与者的用例时,如何绘制用例图?

[英]How to draw a use case diagram when an actor can change the other actor's use cases?

Let's take a social group system as example; 让我们以一个社会团体系统为例;

  • Actors are the Admin and the Moderator. 参与者是管理员和主持人。

  • Use Cases : 用例 :

    ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ (Delete posts) (删除帖子)
    ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎‏‏‎ / /
    ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ moderator --- (Report Post) 主持人---(Report Post)
    ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏⬆️ ⬆️
    ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ ‏‏‎ Admin --- (Manage roles) 管理员-(管理角色)

  • Moderator's posts can be changed by admin, for example the admin can disable report posts for some moderators. 管理员可以更改主持人的帖子,例如,管理员可以禁用某些主持人的报告帖子。

The question is : How to simulate the use case diagram for this situation ? 问题是 :如何针对这种情况模拟用例图?

There is nothing special to do, in a lot of cases the execution of an UC has impact on the system ... and this is the goal of these UCs. 没有什么特别的事情要做,在很多情况下,UC的执行会对系统产生影响……这就是这些UC的目标。

So nothing special in the diagram, but in the textual description you can say the report was written by the moderator etc 因此,图中没有什么特别的,但是在文本描述中,您可以说该报告是由主持人撰写的,等等。

在此处输入图片说明

The fact that one actor can change another user's role (and thus make the user belong to another category of actors) is without any impact on the use case diagram . 一个事实演员可以更改其他用户的角色(从而使用户属于演员的另一个范畴)是没有任何影响的用例图

Why ? 为什么呢 Because a use case actor is a classifier . 因为用例参与者是分类器 So, it does not represent the occurence of a user (ie a concrete user who's role might change) but a class of users having the given role. 因此,它并不代表用户的出现(即,角色可能发生变化的具体用户),而是代表具有给定角色的一类用户。

在此处输入图片说明

Also important to know, a use case does not represent a workflow. 同样重要的是要知道,用例并不代表工作流程。 A use case represents goals that a user could have. 用例表示用户可能具有的目标。 The include and extend relations represent a relation between goals and not between actions of one and the same user. includeextend关系表示目标之间关系,而不是一个用户和同一用户的动作之间关系 So if a user belongs to another actor class, he/she just have different goals and the old goals are no longer relevant. 因此,如果用户属于另一个演员类,那么他/她就拥有不同的目标,而旧目标就不再重要。

If you mean to represent workflows , you should consider using activity diagrams (or non-UML BPMN diagrams ). 如果要表示工作流 ,则应考虑使用活动图 (或非UML BPMN图 )。 In these diagrams, you then need to foresee the course of action if the change of user role might influence the workflow. 在这些图中,如果用户角色的更改可能影响工作流程,则您需要预见操作的过程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM