UML, include, extend relationship

怎甘沉沦 提交于 2019-12-01 01:51:37

I've done a lot of consulting on use cases and it has always been very problematic topic and hard to learn and master. It is definitelly a good idea to consider some other method to specify reqs and system functionality (like UI prototypes, wireframes, etc). In theory use cases are really neat tool, but in the practice it is ofter hard to learn, time consuming, unclear, confuses the team and the customers, hard to check/verify, even harder to keep updated, etc.

I've tried to clarify these two relationships here, using your example, slightly extended to cover both relationships and put the emphasis on the differences:

Note that "Place order" use case will have several scenarions, two of which are relevant here:

  • "Place Order" with previous Authentication - in this scenario the "Authenticate" UC will not be invoked
  • "Place Order" with no previous Authentication - in this scenario the invocation of the "Authenticate" is MANDATORY in order to place the order successfully.

Very frequent source of confusion and mistakes in UC modelling arises from this situation. Some modellers think that MANDATORY in the context of "include" means that it must be ALWAYS executed in the context of including UC, in every single scenario. If it is not the case (like here, there is only one scenario when it is mandatory) they use extend. This is an error, as it is enough that a UC is mandatory in at least one scenario. These details are not shown on the diagram level, but rather in the scenario descriptions.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!