简体   繁体   中英

Why there is no include link between create and delete use cases

I have seen on the internet many examples of use cases diagrams (in UML) as this one:

在此处输入图片说明

What I see is that the delete use case does not include the create use case. Even though I can't imagine deleting a user without creating it.

I wonder why it is still right to not use the include ? And I wonder when should I use it and when to not use it ?

If there is Delete-User - - <<include>> - -> Create-User that means during the execution of the UC Delete-User the UC Create-User is also executed, and of course that has no sense.

The expected behavior can be :

  • Delete-User has the prerequisite Create-User was successfully executed for the same user and Delete-User was not already executed successfully for the same user (after the last Create-User then)
  • or Delete-User can be executed without prerequisite but if the user does not exist ( Create-User was not executed successfully for the same user, or Delete-User was already executed for the same user after the last creation or the user) this is an error case

Bruno's excellent answer already explains why it's not a good idea to include Create into Delete , and what alternatives may be used to express the relation that you explained between the two use-cases.

But in case it helps, here another angle:

  • A use-case diagram does not represent a logical sequence of activities.
  • A use-case only represents a goal for an actor that motivates his/her interaction with the system independently of the other use-cases and the system's history. So, the simple fact that a sysAdmin may want at a moment in time to delete a User is sufficient for the use-case Delete to exist on its own.
  • include shows that a goal may include some other goals of interest for the user. Inclusion is not for functional decomposition where you'd break down what needs to be done in all the details. It's not either to show the sequential dependency. So for Delete , you shall not include what happens before, because happens-before is sequentiality. Inclusion only highlight some relevant sub-goals that are meaningful for the user and that the user always want to achieve when aiming at the larger goal.
  • finally, a use-case Delete may have perfect sense even if the use-case Create was never performed by any actor, for example because:
    • the new system took over a legacy database with all its past account, and the first thing that the SysAdmin will do in the new system, will be to clean-up the already existing old unused accounts before creating new ones.
    • the SysAdmin wants to Delete an account but finds out only during the interaction that the account didn't exist, was misspelled, or was already deleted. These possibilities are all be alternate flows that you would describe in the narrative of the the same use-case.
    • or if not Create use-case would be foreseen, because the user creation would be done automatically in the background (eg based on an SSO), without the actors being involved at all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM