Previous UML Classes Table of Contents UML Packages Next


16.3.5 Include

UseCases


   An include relationship defines that a use case contains the behavior defined in another use case.

*Generalizations

   DirectedRelationship (from Kernel ) on page 62

Issue 8465 -Add NamedElement as parent 8467 - same as 8465

   NamedElement (from Kernel , Dependencies ) on page 99

   Description

   Include is a DirectedRelationship between two use cases, implying that the behavior of the included use case is inserted into the behavior of the including use case. It is also a kind of NamedElement so that it can have a name in the context of its owning use case. The including use case may only depend on the result (value) of the included use case. This value is obtained as a result of the execution of the included use case.

   Note that the included use case is not optional, and is always required for the including use case to execute correctly.

   Attributes

   No additional attributes

   Associations

   Constraints

   No additional constraints

   Semantics

   An include relationship between two use cases means that the behavior defined in the including use case is included in the behavior of the base use case. The include relationship is intended to be used when there are common parts of the behavior of two or more use cases. This common part is then extracted to a separate use case, to be included by all the base use cases having this part in common. Since the primary use of the include relationship is for reuse of common parts, what is left in a base use case is usually not complete in itself but dependent on the included parts to be meaningful. This is reflected in the direction of the relationship, indicating that the base use case depends on the addition but not vice versa.

   Execution of the included use case is analogous to a subroutine call. All of the behavior of the included use case is executed at a single location in the included use case before execution of the including use case is resumed.

   Notation

   An include relationship between use cases is shown by a dashed arrow with an open arrowhead from the base use case to the included use case. The arrow is labeled with the keyword «include». (See Figure 16.4.)

*Examples

   A use case Withdraw includes an independently defined use case Card Identification.


   Figure 16.4 - Example of the Include relationship

   Rationale

   The Include relationship allows hierarchical composition of use cases as well as reuse of use cases.

   Changes from previous UML

   There are no changes to the semantics or notation of the Include relationship relative to UML 1.x.