Mastering UML Use Case Modeling: Understanding Include and Extend Relationships with Visual Paradigm

In the realm of software engineering and business analysis, the Use Case Diagram serves as a critical blueprint for defining system functionality from the user’s perspective. It bridges the gap between technical requirements and user needs, offering a visual representation of how actors interact with the system. This tutorial dissects a specific Document Management System (DMS) scenario to provide a deep dive into the mechanics of include and extend relationships. We will explore how these connectors allow us to build modular, reusable, and flexible system models.

Decoding the Actors and System Scope

Before analyzing the complex relationships, we must identify the primary stakeholders and the scope of the system. In our DMS example, the diagram identifies two distinct actors, each with specific responsibilities:

  • Site User: This actor represents the general audience or employees who consume information. Their primary goals are to search for documents, browse content, and view events.
  • Webmaster: This actor represents the system administrator. Their responsibilities include content management, specifically uploading documents, posting news, and managing user access.

The ovals in the diagram represent Use Cases, which are specific behaviors or functions the system performs. The lines connecting the actors to the ovals represent associations, indicating who can perform which actions.

The Power of Reusability: The Include Relationship

The <<include>> relationship is the backbone of modular design in Use Case modeling. It signifies that one use case (the base) explicitly requires the functionality of another use case (the included) to complete its execution. Think of it as a mandatory subroutine.

Let us examine the logic behind the Search Docs – Full Text use case:

  1. The Scenario: A user wants to find a specific document using keywords.
  2. The Dependency: To fully satisfy the “Search” requirement, the system must return a list of results. However, users often want to see what the document contains before downloading it.
  3. The Relationship: The diagram shows that Search Docs includes Download Docs and Preview Doc.

When the “Search” action is triggered, the system logic dictates that the “Download” and “Preview” capabilities are invoked as part of the workflow. This does not mean the user must download everything, but rather that the system must offer these options to complete the search utility.

Similarly, notice the relationship between Browse Docs and Preview Doc. If a user browses the directory structure, the system allows them to preview the content of a file. This is a mandatory part of the browsing experience defined in this specific model.

Handling Conditional Logic: The Extend Relationship

While <<include>> forces functionality, <<extend>> adds optional or conditional behavior. It allows a use case to be extended by another use case under specific conditions. This is crucial for modeling exceptions, optional features, or rare scenarios.

Consider the Upload Docs use case. In a standard flow, a user uploads a file. However, the diagram introduces an Extend relationship pointing to Manage Folders.

This implies the following logic:

  • Base Flow: User uploads a document to a default location.
  • Extension Point: If the user needs to organize the upload into a specific, perhaps nested, directory structure, they trigger the “Manage Folders” function.
  • Result: The “Upload” use case is extended by “Manage Folders” only if the condition of needing folder management is met.

A similar pattern is observed in the administrative tasks. When a Webmaster performs Add User, they might also need to Add Company details if the user belongs to a corporate entity. This is an optional step (an extension) rather than a mandatory requirement for every user creation.

Visualizing the Flow in Visual Paradigm

When modeling this architecture using Visual Paradigm, it is essential to understand the visual syntax. The arrows in UML are not just connectors; they carry semantic meaning.

  • Dashed Line with Open Arrowhead: This is the standard notation for dependencies, including both include and extend relationships.
  • Stereotypes: The text <<include>> and <<extend>> placed near the arrows define the nature of the dependency.
  • Directionality: For <<include>>, the arrow points from the base use case (Search) to the included use case (Download). For <<extend>>, the arrow points from the extending use case (Manage Folders) to the base use case (Upload).

Conclusion

By effectively utilizing include and extend relationships, the DMS model becomes more than just a list of features; it becomes a logical map of system behavior. The Include relationship ensures that essential sub-functions are never missed, promoting code reuse. The Extend relationship keeps the base use cases clean and simple by isolating optional logic. Mastering these concepts allows architects to design systems that are robust, scalable, and easy to understand.