UML之间的关系(扩展/包含) [英] UML relation between usecases (extend/include)

查看:223
本文介绍了UML之间的关系(扩展/包含)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不明白以下主题,因为它与我所读的有点不一样:

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


  • Inlcude

但是,当有include只有在某些IF声明中是真的,如:
添加新产品---> include --->添加新的制造商。 //仅当不存在时才添加为什么没有延伸?是因为其他地方可能再次使用添加新的制造商?
谢谢

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

推荐答案

确切地说。一旦你扩展了另一个用例,你已经到目前的用例结束了。但是,你可以在if里面扩展。想象一下,

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)]

include不会结束用例,它使用另一个用例,然后返回。包含类似于函数调用。您在其他功能中执行操作,然后返回并继续。您还可以在没有if语句的情况下使用include。

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

请注意,在上面的延伸将不起作用。这是因为司机还需要到第二个窗口拿到食物。如果我们延伸到使用案例3,那么我们永远不会回到这个用例。

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之间的关系(扩展/包含)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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