1

I have a question regrading usecase diagram which im rather confused when to use extended and include. Ive gone through a tone of documents and tutorial and examples. But im rather confused.

I have a scenario where it says "you can make a booking for either fitness classes or personal trainer session".

So the model I have so far has a usecase called "make booking" and usecase "make booking" extends to 2 other uses cases called "Book fitness class" and "Book PT session".

Is that valid with contrast to having two independent usecase called "book classes" and "book PT session".

Im for sure latter method is right. However im not quite sure if my fomer method is right tho. Could anyone help me understand?

Thanks

Hari
  • 11
  • 2

1 Answers1

0

Book classes and book PT session both could extend the base booking use case. They are variations of this use case. ( Notice the direction of extension, please!)

Of course, you can show the common features of these cases through including as well, dividing the abstract functionality into more specific ones and showing what functionalities are used by several abstract use cases.

Both ways are allowed, but in the second way you are showing the construction of the model and in the first way you are showing the philosophy of the model. If you may, you should postpone the second variant to the more elaborated stages of modelling. But sometimes you simply have to use some piece of model due to specific requirements and have to use including from the start.

As for the extending, it is good for both first and last stages, only has a little different sense in them. On the last stages it could suppose the use of a class derived from another one.

You CAN use two independent use cases, too, but thus you are simply ignoring the fact of their real dependence. It is BAD not to show in the diagram the fact you already know. In a small task you probably won't forget the fact, but in a real model it will be forgotten and misinterpreted for sure.

Gangnus
  • 24,044
  • 16
  • 90
  • 149
  • Thanks very much! Ive been reading other posts on here and it seems to confuse and contradicts with the your explanation. One of the primary element which causes the mus-understanding is the usecase "Make booking". So base usecase itself is not valid, it cant do anything by itself. And therefore is not valid. The base usecase is very dependent on the extended usecases "book classes" and "book Pt classes". http://programmers.stackexchange.com/questions/259826/uml-2-0-use-case-diagrams-extend/259833#259833 – Hari Oct 13 '14 at 14:08
  • I am afraid, it is more misunderstanding than contradiction. Why usecase by itself is not valid? You mean showing closely connected usecases separately? It is not INVALID in UML sense, it is simply a bad and dangerous style – Gangnus Oct 14 '14 at 07:29