UML relation between usecases (extend/include)

后端 未结 2 720
轻奢々
轻奢々 2021-01-17 06:24

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 i
相关标签:
2条回答
  • 2021-01-17 06:51

    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.

    0 讨论(0)
  • 2021-01-17 06:58

    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 讨论(0)
提交回复
热议问题