Search code examples
umlcruduse-caseuse-case-diagram

Specialization or extension point use case


I have a use case here for delete. This is trying to demonstrate that a user can delete Users, Projects and Posts. If you want to do delete a User, you select "User" from the deletion menu, a user menu dialog box will pop up where you will type a name and press "Delete" to confirm deleting that user. For Projects, you select "Project" in the deletion menu and another menu pops up where you type the projects name and click "Delete" to delete the project. That is how I am looking to implement it in software. However displaying it in use case I am a little confused. Is this a good use of extension point use case to demonstrate that functionality or is a specialisation better to use in this scenario where the parent would be "Delete" with children named "Delete User", "Delete Project" etc...

enter image description here

Based on Writing Effective Use Cases by Alistair Cockburn

My personal tendency is to write "Manage X", to get the advantage of less clutter, unless it turns out not to work well for some reason, usually related to the complexity of the writing, and only then break it out into "Create X", "Update X", "Delete X"

enter image description here

Specialization enter image description here


Solution

  • The UML specs explain that:

    The extended UseCase is defined independently of the extending UseCase and is meaningful independently of the extending UseCase.

    In your case, I doubt that Delete is meaning independently of Delete User, Delete Project, and Delete post. The point is that the use-cases are independent of the internal implementation of the software. They should in principle represent user goalds and the set of behaviors needed to achieve them.

    In Writing effective use-cases Cockburn dedicates a chapter to CRUD and parameterized use-cases. He provides a useful question:

    The question is, are they all part of a bigger case or are they separate? In principle, they are separate because each is a separate goal, possibly carried out by a different person with a different security level. However, they clutter up the use-case set and can tripple the number of items to track.

    He proposes several approaches, including the principle of parametric use-cases: a generic use case (i.e. a generalization) describes the general behavior, and parameters are used to specialize the use-case description. ALthough his book is about use-case speicifications and not use-case diagrams, he describes an idea that is much closer to specialization than extension.