对于扩展或包含的用例,我是否要使用相同的参与者? [英] Have I to use the same actors for those extending or included use cases?

查看:100
本文介绍了对于扩展或包含的用例,我是否要使用相同的参与者?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在刷新/更改我在软件开发方面的知识,因为我将很快在这一领域工作。在大学里,我们已经学到了很多有关UML图和编码的知识,但是我从来没有在一个真正的Project中将它们融合在一起。因此,我开始在Grails中创建一个测试网络应用,我想从需求分析和用例着手,使其与现实保持紧密联系。

I am currently refreshing/altering my knowledge in software development because I will work in this area soon. We have learned a lot about UML diagrams and coding at University, but I have never brought it all together in a real Project. Therefore, I started to create a test web-app in Grails, and I wanted to begin with a requirements analysis and use cases too keep it close to reality.

我的网站-app应该允许用户共享食谱,查找食谱并查看其他用户的食谱。每个食谱都有很多成分,这些成分不仅是字符串,还包括实体,因此卡路里,脂肪,蛋白质和碳水化合物可用于自动计算特定食谱的营养成分。

My web-app should allow users to share recipes, find recipes and review recipes by other users. Every recipe has many ingredients, which are not just strings but rather entities so that calories, fat, protein and carbs can be used to automatically calculate nutrition facts of a certain recipe.

消费者或营养专家都可以将成分添加到数据库中。如果它是由消费者创建的,则它只是预期成分,这意味着必须由管理员验证才能成为适当成分-否则会被标记,例如红色文本颜色。

An ingredient can be added to the database by either a consumer or nutrition expert. If it is created by a consumer, it is only a "prospective" ingredient, meaning that it has to be verified by an administrator to become a "proper" ingredient -- otherwise it is marked, e.g. red text color.

这是我当前的用例图:

http://ubuntuone.com/0zDw9kEbj1BwtXjnCtxdwC

我的问题是:


  • 如果我使用包含或扩展,对于那些扩展或包含的用例,我是否必须使用相同的主要参与者? (在屏幕截图中: AddProspectiveIngredient 可以具有与 CreateRecipe 不同的主要角色吗?的相同问题包括

  • If I use include or extend, will I have to use the same primary actors for those extending or included use cases? (In the screenshot: Could AddProspectiveIngredient have a different primary actor than CreateRecipe? Same question for include)

编辑:我不认为这个问题广泛地说:如果我使用包含或扩展,对于那些扩展或包含的用例,我是否必须使用相同的主要参与者?

EDIT: I don't think the question is asked broadly: If I use include or extend, will I have to use the same primary actors for those extending or included use cases?

我同意,因为这是我对Stackoverflow的第一个问题,所以一开始会有一些不必要的样板。如果是这种情况,我可以编辑我的问题以使其保持打开状态。我仍然希望有人偶然发现它,并为我提供更多的知识或资源。

I agree, as this was one of my first questions on Stackoverflow, that there is some unnecessary boilerplate in the beginning. If that is the case, I can edit my question to keep it open. I am still hoping for someone to stumble upon it and provide me with more knowledge or sources.

推荐答案

如果我使用包含或扩展,对于扩展或包含的用例,我是否必须使用相同的主要参与者?

扩展表示一个用例是另一用例的变体。这是定义,对不起。因此,我不确定您的意思是真的,但是不同的参与者可以轻松地进行不同的活动变化。

Extend means that one Use case is a variation of another one. It is the definition, sorry. So, I am not sure you really meant it, but different variations of activity can be easily conducted by different actors.

对于 include 来说,并不是那么简单。一种行为插入另一种行为。对于用例的概括,这是一些变体。

As for include, it is not so simple. One behaviour is inserted in another one. It is some variation for generalizations for use cases.

因此,如果行为A包括B,并且演员X仅连接到A,而演员Y仅连接到B,则意味着Y确实也是A ,但并非全部。 X具有Y的所有行为以及一些其他行为。

So, if behaviour A includes B, and actor X is connected only to A and actor Y is connected only to B, that means, that Y really makes A, too, only not all of it. X has all behaviour of Y and some additional behaviour. And that means that X is derived from Y, or X is a subclass of Y.

简单来说,如果您为A和B拥有不同的不附带条件的actor,那么您就有了简直是误会。他们绑在一起。

Simply, if you have different not-tied actors for A and B, you have simply mistaken. They ARE tied.

这篇关于对于扩展或包含的用例,我是否要使用相同的参与者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆