I need to specify use cases for deleting 2 type of objects x and y, where y is a list of object x.
I want to avoid the excessive fragmentation of use cases, because the flow of event between the 2 use cases is similar.
Should I specify 2 use cases, Delete x
and Delete y
, or a single use case Delete object
with the main scenario for deleting x and an alternative scenario for delete y? Or there is a better solution? More generally, for similar cases such as for example sharing objects x and objects y, what would be the recommended approach and when to use the alternative scenarios?
Here is what I meant with the first option:
Use case Delete x
Pre-conditions: Authentication Post-Condition: The object x is deleted Main scenario: 1.The actor starts the use case 2.The system shows the list of objects x 3.The actor selects the object x to delete 4.The system deletes the object x
Use case Delete y
Pre-conditions: Authentication Post-Condition: The object y is deleted Main scenario: 1.The actor starts the use case 2.The system shows the list of objects y 3.The actor selects the object y to delete 4.The system deletes the object y
And the second option:
Use case Delete Object
Pre-conditions: Authentication Post-Condition: The object is deleted Main scenario: 1.The actor starts the use case 2.The system asks to the actor if he want to delete object x or object y 3.The actor makes his choice 4.The system shows the list of objects x 5.The actor selects the object x to delete 6.The system deletes the object x 3.a 1. activate the scenario "Object y" Alternative scenario #1 - Object y 1.The system shows the list of objects y 2.The actor selects the object y to delete 3.The system deletes the object y
You should identify the relevant use-cases based on the user goals, and not based on the user interface or the internal structure of the system.
Considering your explanation, and assuming you need to work at that level of detail:
However, your example suggests that you may have other CRUD use-cases. And there are better approaches for CRUD if you do not want to end with a lot of cases and scenaros: make use of specialisation (inheritance): write a general scenario, with a placeholder for the objects that actor want to delete. In this case, you would not need additional scenarios or additional use-cases, except if the one or the other objects needs different behavior, in which case you'd better not repeat yourself and document the special case as an alternative scenario.
More information in these SO questions:
Btw: congratulations for the authentication as pre-condition!