Similar Uses Case. How do the better solution?

200 Views Asked by At

For my project i need to do Uses Case Diagram. These are my uses cases but i think this solution isnt correct. Cliente use case

Search shop -> Cliente find all shop in the system

Search shop in your city -> Cliente find shop of his city

Search shop in by city by category -> Cliente find shop in a input city with an input category

Search shop by category -> Cliente find all shop with the input category

I was thinking of using an extension as they basically do the same thing but some with some different steps.

From mine definition: Alternative or optional behaviors of a use case set of use cases that extend the general use case

So i think like this

enter image description here

But i dont know if my solution is right or not because i'm not sure about <>

The client must be able to do these 4 searches.

Is it better the first or second solution? And why? Are there other better solutions?

EDIT: I'm trying a new solution.

Mine problem: Cliente can make different searches in the system.

enter image description here

enter image description here

Adding scenarios to mine UC could be better than other solution? I know that an UC can have various extensions of both success and failure. Could I solve my problems by opting for a solution like this?

2

There are 2 best solutions below

3
Christophe On BEST ANSWER

I would like to express another viewpoint in addition to Bruno’s expert and comprehensive answer.

While UML is agnostic of what a use-case should or should not express, there is a wide understanding that use-cases should correspond to actor goals.

When I personally look for a shop, my primary goal is to find a shop. The criteria are just means to achieve this goal. Maybe a shop in my town, maybe the shop closest to my GPS coordinates, maybe I’m looking for a given category, or maybe I will refine my criteria interactively while search results are displayed.

Specifying use-cases that are too detailed will lock you very early into a solution that might pre-define or constrain your user-interface without really having thought about the best and most comfortable way to achieve the goal for the user. The UML founders warned against this drawback and explicitly recommended not to use use-case models for designing a user interface.

I’d therefore keep it simple and just have a use-case Search shop, and describe the more specific intents/expectations in the description associated to each UC (preferably using essential use-cases).

13
bruno On

All depends on what you want to show.

A said by the standard (§18.1.3.2 page 640 of formal/2017-12-05) :

Extend is intended to be used when there is some additional behavior that should be added, possibly conditionally, to the behavior defined in one or more UseCases.

So, your second diagram is not equivalent to your first diagram (supposing the use cases unchanged):

  • in the first diagram the client search shop or search shop in your city or search shop by category or ...

  • in the second diagram when a client search shop during it he can also search shop in your city and can also search shop by category and ...

Perhaps you wanted to say during the search it is possible to add filter to search in the city and/or in a category, in that case you can use 2 extends:

enter image description here

Note search shop in city and search shop by category are specialization of search shop, and search shop in city by category a specialization of search shop in city and search shop by category, so:

enter image description here

if you very like generalization in UC


Out of these theoretical considerations about extend/generalization and looking at the UCs by themselves, like in any case about UC, you have to check your UCs are effectively UC, do each has enough plus-value to exist or do you only have the UC search shop ?