用例之间的 UML 关系(扩展/包含)
我不太理解以下主题,因为它与我读到的内容有点含糊:
- 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确切地。一旦扩展了另一个用例,您就已到达当前用例的末尾。但是,您可以在 if 内进行扩展。想象一下以下情况。
包含不会结束一个用例,它使用另一个用例然后返回。包含类似于函数调用。您执行另一个函数中的操作,然后返回并继续。您也可以使用不带 if 语句的包含。
请注意,上面的扩展不起作用。这是因为司机仍然需要去第二个窗口取食物。如果我们扩展到用例 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.
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.
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.
以下是以下主题的说明: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 and Extend relationships on a use case diagram http://i.msdn.microsoft.com/Dd409427.UML_UCOvStructure(en-us,VS.100).png