我不太理解以下主题,因为它与我读到的内容有点含糊:
-
Inlcude就像对下一部分的引用一样,没有它,用例就不完整。这部分应该从更多地方引用,否则它的使用没有意义。
但我见过一个例子,其中“include”仅在某些 IF 语句中为真,例如:添加新产品--->包含--->添加新制造商。 //仅当不存在时添加。为什么没有“延长”?是因为在其他地方可以再次使用“添加新制造商”吗?
谢谢
确切地。一旦扩展了另一个用例,您就到达了当前用例的末尾。但是,您可以在 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,那么我们将永远不会回到这个用例。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)