1

Consider a use-case UC1 that includes UC2 and UC3. The UML 2.5.1 specifications define «include» between two use-cases:

Include is a DirectedRelationship between two UseCases, indicating that the behavior of the included UseCase (the addition) is inserted into the behavior of the including UseCase (the includingCase).
(...)
All of the behavior of the included UseCase is executed at a single location in the included UseCase before execution of the including UseCase is resumed.

I understand that the behaviors of UC2 and UC3 are always executed with UC1, in view of the affirmative wording of the include definition, which implies systematicity and leaves no room for conditionality ("is inserted into", "is executed"), whereas the extend definition explicitly mentions a non mandatory possibility ("can be inserted into", "behavior that should be added, possibly conditionally", see also section 5.1 of the specs about the use of CAN and MAY).

I wonder if my interpretation is too strict. So does the inclusion:

  • mean that whenever UC1 is performed, the behavior of both UC2 and UC3 is always executed, i.e. with the expected observable results for the actors or other stakeholders?
  • Or is it possible that the behavior of one of the use-cases, say UC2, is not always executed? And why would this understanding be compliant with the specs?
4
  • What shall I say? Just don't use include/extend since it deviates from showing added value towards functional decomposition. My POV: a misconception in the specs bred by some coding eggheads. Wait and see what Axel will say (unless he's on holiday now). Commented Aug 30, 2023 at 22:08
  • @qwerty_so indeed! I prefer to focus on goals and avoid inclusions /extensions ith the pitfalls of functional decomposition as much as possible. However, I do not work on a modelling island, and have sometimes to cope with other practices. Moreover, sometimes it make sense imho to express that some goals are also part of larger goals, and in this context I use the include only if it is systematic. Therefore my question. Commented Sep 1, 2023 at 7:37
  • I know. I might work out an answer over the weekend... Commented Sep 1, 2023 at 9:17
  • I reread the chapter Here there be dragons from Bittner/Spence. That would be my answer. Else, technically speaking, Geert's answer is probably the right one - except for the point I commented below. Commented Sep 3, 2023 at 8:34

1 Answer 1

2

There are two possible scenarios in which the behavior of the included use case is not executed:

Precondition in included use case is not met

Suppose UC1 has precondition User must be authenticated, and the user is not yet authenticated. In that case the UC1 would not execute.

Single location of execution of include is not reached

The specs mention a single location where the included use case is executed. Now we all know that a use case does not necesarrily follow a single sequence of steps. Although use case scenarios are not explicitly mentioned in the UML specs, it is common to have a main scenario, and possibly a number of alternate and exception scenarios.

Depending on the circumstances, some or steps in the use case will not be reached, possibly because an alternate scenario path is followed, or maybe because the include location is in an exception path that is not followed this execution.

In those cases I think it is perfectly within the specs to say that the included use case is executed only under certain conditions (i.e. actually reaching that point of execution)

enter image description here

In this example of the scenarios a use case Update Reservation expressed as an Activity Diagram, we see that we only need to execute the use case Update Inventory in the alternate scenario Cancel Reservation

This could have been expressed more clearly in the UML specs.

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you very much for your very clear and illustrated explanation. I have nevertheless a residual concern: in your example, shouldn't "Update Inventory" be an extension rather than an inclusion, because it "augments the execution of the extended use case under specific conditions" ? (extending use cases do not need to make sense on their own, but it's not prohibited if they do, and they as well can take place at one specific point; so how to differentiate extend and include in such a borderline case?)
@Christophe you could (not should) use extend in this case since the main use case doesn't rely on the result of the included use case. With something like Find Customer that is not possible. The main difference between include and extend is the direction of the dependency, not the optionality.
The marked Execute action is an instance of an activity, not a use case itself. The UC where this activity belongs to might have other activities as well. I think that "Include UC xy" can only be expressed in textual form.
@qwerty_so correct. This is a rendering in the form of an Activity diagram of structured scenario of the use case. I prefer this format because it usually gets better feedback from the business than textual scenario's.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.