用例之间的 UML 关系(扩展/包含)

发布于 2024-08-19 12:42:52 字数 260 浏览 11 评论 0原文

我不太理解以下主题,因为它与我读到的内容有点含糊:

  • Inlcude 就像对下一部分的引用,没有它,用例就无法完成。这部分应该从更多地方引用,否则它的使用没有意义。

但我见过一个例子,其中“include”仅在某些 IF 语句中为真,例如: 添加新产品--->包括--->添加新制造商。 //仅当不存在时添加。为什么没有“延长”?是因为在其他地方可以再次使用“添加新制造商”吗? 谢谢

I do not understand well following topic since it is a bit ambiguous from what I read:

  • Inlcude is like a reference to next part, the usecase is not completed without it. This part should be referenced from more places otherwise its use has no sense.

But I have seen an example when there is "include" only in some IF statement is true, like:
Add new product--->include--->Add new manufacturer. //Adds only when doesnt exist. Why there isnt "extend"? Is it because somewhere else could be "Add new manufacturer" used once again?
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

寒尘 2024-08-26 12:42:52

确切地。一旦扩展了另一个用例,您就已到达当前用例的末尾。但是,您可以在 if 内进行扩展。想象一下以下情况。

1) The driver asks if his guests want Wendys or Burger King
2) The guests choose they want Burger King [extend to eating at Burger King (use case 5)]
3) The guests choose they want Wendys [extend to eating at Wendys (use case 9)]

包含不会结束一个用例,它使用另一个用例然后返回。包含类似于函数调用。您执行另一个函数中的操作,然后返回并继续。您也可以使用不带 if 语句的包含。

1) The driver orders the food
2) The driver drives to the first window
3) The driver pays the cashier (include handling a credit card transaction (use case 3)]
4) The driver drives to the second window
5) The driver gets the food

请注意,上面的扩展不起作用。这是因为司机仍然需要去第二个窗口取食物。如果我们扩展到用例 3,那么我们将永远不会回到这个用例。

Exactly. Once you extend another use case you've reached the end of your current use case. However, you can have extend inside an if. Imagine the following.

1) The driver asks if his guests want Wendys or Burger King
2) The guests choose they want Burger King [extend to eating at Burger King (use case 5)]
3) The guests choose they want Wendys [extend to eating at Wendys (use case 9)]

An include doesn't end a use case, it uses another use case and then returns. An include is similar to a function call. You perform the actions in the other function and then you return and continue. You can also have an include without an if statement.

1) The driver orders the food
2) The driver drives to the first window
3) The driver pays the cashier (include handling a credit card transaction (use case 3)]
4) The driver drives to the second window
5) The driver gets the food

Notice that in the above an extend wouldn't work. This is because the driver still needs to go to the second window and get the food. If we extended to use case 3 then we would never return to this use case.

余生再见 2024-08-26 12:42:52

以下是以下主题的说明:UML 用例图:参考,位于 http://msdn.microsoft.com/en-us/library/dd409427%28VS.100%29.aspx

包含:包含用例调用或调用被包含的用例。包含用于显示如何
用例分为更小的步骤。包含的用例位于箭头端。

扩展:扩展用例向扩展用例添加目标和步骤。扩展
仅在特定条件下运行。扩展用例位于箭头端。

在用例图上包含和扩展关系 http: //i.msdn.microsoft.com/Dd409427.UML_UCOvStructure(en-us,VS.100).png

Here's an explanation from the following topic: UML Use Case Diagrams: Reference at http://msdn.microsoft.com/en-us/library/dd409427%28VS.100%29.aspx

Include: An including use case calls or invokes the included one. Inclusion is used to show how
a use case breaks into smaller steps. The included use case is at the arrowhead end.

Extend: An extending use case adds goals and steps to the extended use case. The extensions
operate only under certain conditions. The extended use case is at the arrowhead end.

Include and Extend relationships on a use case diagram http://i.msdn.microsoft.com/Dd409427.UML_UCOvStructure(en-us,VS.100).png

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文