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 :
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:
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.Delete
may have perfect sense even if the use-case Create
was never performed by any actor, for example because:
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.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.