[英]How do i design a UML use case diagram
I am trying to design a use case diagram for the following scenario.我正在尝试为以下场景设计用例图。
I have a society that is distributing goods to clients based on their orders.我有一个社会,它根据客户的订单向客户分发商品。 These clients can be administrations, companies, or private individuals.这些客户可以是行政部门、公司或个人。 Depending on what the client is I want to know more or less of their info (name, number etc)根据客户是什么,我想或多或少地了解他们的信息(姓名、号码等)
The use cases are different depending on whether the client is:用例因客户端是否为:
For example:例如:
The 1) English clients' orders are accepted only if they pay a small fee in advance. 1) 英语客户的订单只有在他们提前支付少量费用的情况下才会被接受。
The 2) English clients that have used the service for 3 years don't have to pay this fee but need to get approbation from a different actor (an Agent in this case) 2) 使用该服务 3 年的英语客户无需支付此费用,但需要获得不同演员(在这种情况下为代理人)的认可
The 3) Foreign clients' orders are always accepted no matter what. 3) 无论如何,外国客户的订单总是被接受。
This right here is where I run into trouble and need help with.这就是我遇到麻烦并需要帮助的地方。
The orders from nglish clients that have a criminal record are always denied UNLESS they are an administration.来自有犯罪记录的英国客户的订单总是被拒绝,除非他们是行政部门。
What are the most optimal actor choices here?这里最好的演员选择是什么? I thought of going with English client
, and Foreign clients
but I don't know how to include the "Unless the client is an administration" in the use case.我想过使用English client
和Foreign clients
但我不知道如何在用例中包含“除非客户是管理人员”。
The use case diagram is not the right place to put this information.用例图不是放置这些信息的正确位置。 As correctly pointed out by @Christophe, a use-case represents a goal for a user who is going to interact with the system to achieve the goal .正如@Christophe 正确指出的那样,用例代表将与系统交互以实现目标的用户的目标。
This means that there is only one single use case in your scenario: "Order Goods" .这意味着您的场景中只有一个用例: "Order Goods" 。 However, it has a set of preconditions .但是,它有一组先决条件。 You could list them as structured plain text.您可以将它们列为结构化纯文本。 Since there is quite some complexity behind each of them, I recommend to put them into a separate decision chart.由于它们每个背后都有相当多的复杂性,我建议将它们放入单独的决策图中。 Then you have a nice clean separation of the diagram scopes, and they remain easily readable.然后,您可以很好地将图表范围分开,并且它们仍然易于阅读。
Sidenote: There could be a second one "distribute ordered goods" executed by a 2nd actor who is an employee who does fulfillment / routing / dispatching.旁注:可能会有第二个“分发订购的货物”由第二个演员执行,该演员是执行/路由/调度的员工。
Actors in UML use-cases are classifiers. UML 用例中的参与者是分类器。 To decide about which actors to create requires to understand the actors their goals and behaviours and how they differ in the interaction with the system.要决定创建哪些参与者,需要了解参与者的目标和行为,以及他们与系统交互的不同之处。
First of all, you need to clarify the super-ambiguous requirements:首先需要明确一下超模棱两可的需求:
Use-cases should in principle be goal oriented.用例原则上应该是面向目标的。 So a use-case represents a goal for a user who is going to interact with the system to achieve the goal.因此,用例代表将与系统交互以实现目标的用户的目标。 Use-cases are not meant to describe the detailed sequence of your process (if client is this, do that, etc...) and neither are actors meant for that purpose.用例并不意味着描述你的流程的详细顺序(如果客户是这个,那么做,等等……),参与者也不是为了这个目的。
You should therefore consider reformulating the use-cases to represent how the actors would perceive them.因此,您应该考虑重新制定用例以表示参与者如何看待它们。 If needed you may consider the status of the actor that could explain that an actor behaves very differently.如果需要,您可以考虑演员的状态,这可以解释演员的行为非常不同。 Typically in your case, I could imagine :通常在你的情况下,我可以想象:
The need to pay an advance fee seem to depend on the address, nationality, history.是否需要支付预付费用似乎取决于地址、国籍、历史。 It's more related to the process (it's a part of it) than an independent goal for an actor.它与过程(它是过程的一部分)的相关性比演员的独立目标更相关。 So I would neither show this as a use-case nor make different actors for this purpose.因此,我既不会将此作为用例展示,也不会为此目的制作不同的演员。
The reason to deny an order is not something that is not relevant for the customer (no customer has a goal go get a purchase denied!).拒绝订单的原因与客户无关(没有客户有目标,拒绝购买!)。 It's relevant to you and your system and is a consequence of the registration process.它与您和您的系统相关,是注册过程的结果。 So no need to have a dedicated actor for that.所以不需要专门的演员。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.