开发者

UML relation between usecases (extend/include)

开发者 https://www.devze.com 2022-12-18 08:37 出处:网络
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 referenc

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 manuf开发者_开发知识库acturer. //Adds only when doesnt exist. Why there isnt "extend"? Is it because somewhere else could be "Add new manufacturer" used once again? Thanks


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消