2

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

2 Answers 2

1

I think your former method might not work, here's my reasoning:

  • In extend situation, the base use case should be complete by itself, and doesn't need to depend or know about extend use case. Complete here means it should contains a complete sequence of user interaction that achieve the use case purpose.

  • So you can ask yourself: does "make booking" base use case work without "book fitness class" and "book PT session" extend use cases? To me, "make booking" by itself doesn't do anything, and it's dependent on the other 2 use cases.

  • I usually think of extend use case as alternate use case, only triggered when some condition is met in base use case

Hope it helps

2
  • I understand where you coming from. Indeed "make booking" cant do anything by itself. How about doing this have call "Book classes" and have and extension to usecase "book Pt classes". Would that make any sense. Or is it better to leave it simplified by having it ad two different usecases?
    – Hari
    Commented Oct 13, 2014 at 10:16
  • In my opinion, that is another possible way of modeling these use cases. It even makes more sense for me than modeling as 2 separate use cases, although I'm by no means an expert in use case modeling :) Commented Oct 14, 2014 at 3:27
0

The following may sound a bit artificial, but you should get the point (think of it as a Web-App):

The scenario you give is:

  • Selecting a gym-class

In order to achieve that, you need to display the different classes. Or to put it into UML-Speak: selecting a gym-course includes displaying the different classes.

You use include as something like an import of another use-case: to do x it is necessary to do y, which is in itself an independend usecase (e.g. displaying could also be used only for information without the possibility to select anything).

If you want to book some extras like sauna after training, this is also some kind of import, but this time it is fully optional, which is in UML the extend relationship. In case of a web form, think of a simple checkbox: sauna ✓ after the checkbox for the class.

booking a gym-class includes displaying the classes and booking sauna extends booking a gym-class. Booking sauna is in itself an independend use-case and could be done without booking a gym-class. Furthermore - and that is where the difference lies - it is not necessary to book sauna in order to book a gymclass, its facultative.

Or in ordinary language:

In order to book a gymclass, you have to display the overview. Additionally you could also book sauna together with the class.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.