include vs extend in use case diagram example

Include vs Extend in Use Case Diagram: UML Example

By Rachel Johnson
AD

In the realm of software engineering, clairvoyance in decision-making can be pivotal. Two such pivotal decisions often arise when designing reusable components: whether to use Include or Extend. Both are powerful tools in use case modeling, and understanding their differences can help us apply them effectively. Let's explore this through an example.

The choice between Include and Extend in use case diagrams can be subtle yet profound. It's like choosing between two intuitive but distinct paths in a labyrinth - each offers unique advantages, and knowing when to pick one over the other is an art in itself.

Understanding 'Include' in Use Case Diagrams

In simple terms, 'Include' in use case diagrams dictates that one use case incorporates the steps of another. It's like a recipe that borrows steps from another, aiding in breaking down complex processes into manageable chunks.

AD
UML Use Case Diagram Tutorial with Examples
UML Use Case Diagram Tutorial with Examples
Use Case Diagram Tutorial: What It Is and How to Create One | Creately
Use Case Diagram Tutorial: What It Is and How to Create One | Creately
Use Case Diagram | Learn UML | Omer Javed Articles
Use Case Diagram | Learn UML | Omer Javed Articles

'Include' Use Case Example: 'Return Order' Including 'Order' Use Case

Consider a logistics company's system. The 'Return Order' use case consists of ordering a return shipment, similar to placing a normal order. So, it makes sense for 'Return Order' to include steps of the 'Order' use case. This reuse saves effort and promotes consistency in the system.

'Include' in Complex Use Case Hierarchy

Now, let's imagine a sprawling use case hierarchy with multiple levels of abstraction. Use case A includes use case B, B includes C, and C includes D. This structure builds complexity gradually, allowing for fine-grained and yet simple component reuse. However, it's crucial to strike a balance - too many dependencies can cause a pyramid scheme-like effect.

How to create a use case diagram | moelgendy blog
How to create a use case diagram | moelgendy blog
Use Case Diagram for Event Management System
Use Case Diagram for Event Management System
Use Case Diagram for Student Enrollment System
Use Case Diagram for Student Enrollment System

The 'Extend' Mechanism in Use Case Diagrams

'Extend' topology in use case modeling signifies that, under certain conditions, a use case will 'branch off' into another use case's flow. It's like a road diverging in a woods, with one path veering off to explore an enchanted universe.

'Extend' Use Case Example: 'Withdraw' Extending 'Bank Transaction'

Take the case of a banking system. The 'Withdraw' use case extends 'Bank Transaction'. When the 'Withdraw' use case is activated, it follows the flow of the 'Bank Transaction' use case until it reaches a specific point, 'Amount Check'. Here, it adds its own steps - validating the withdrawn amount and drafting the cheque - before resuming the 'Bank Transaction' flow.

AD

'Extend' in Orchestrating Special Cases

'Extend' comes in handy when dealing with unusual scenarios that fall outside the norm. The base use case deals with the common case, while the extended use case tackled the corner case. This separation enables a clean division of responsibilities, making the system easier to understand and maintain.

UML Use Case Diagram for Airline Reservation
UML Use Case Diagram for Airline Reservation
Download Use Case Diagram for Library Management System
Download Use Case Diagram for Library Management System
Bank Transaction System | Creately
Bank Transaction System | Creately
Use Case Diagram for E-Commerce Websites
Use Case Diagram for E-Commerce Websites
Life Insurance System Use Case Diagram
Life Insurance System Use Case Diagram
UML Use Case Diagrams: Tips
UML Use Case Diagrams: Tips

Choosing Between 'Include' and 'Extend'

In decision-making, consider the context and the nature of the functionality. Use 'Include' when one process largely mirrors another, with minimal deviation. Use 'Extend' when there’s a need to add specific functionality branching off from an already established flow.

In the end, striking a balance between 'Include' and 'Extend' is about harnessing the power of modularity, promoting code reuse, and ensuring our systems remain clean, manageable and scalable. As the sun sets today, remember the labyrinth's paths and choose wisely. Tomorrow, when you face another crossroads, your decision will already be half-made.

AD
UML Use Case Diagram
UML Use Case Diagram
End-to-End UML: Use Case Diagram
End-to-End UML: Use Case Diagram
a diagram that shows the flow of different items in an organization, including two people and one person
a diagram that shows the flow of different items in an organization, including two people and one person
Use Case Diagram Tutorial: What It Is and How to Create One | Creately
Use Case Diagram Tutorial: What It Is and How to Create One | Creately
Student Attendance System | Creately
Student Attendance System | Creately
Shop System Use Case Diagram
Shop System Use Case Diagram
Online Shopping System (UML Use Case Diagram)
Online Shopping System (UML Use Case Diagram)
Use Case Diagram for ATM Machine
Use Case Diagram for ATM Machine
What is a Use Case Diagram?
What is a Use Case Diagram?
Use Case for Airline Reservation
Use Case for Airline Reservation
Use Case Diagram for Car Rental System
Use Case Diagram for Car Rental System
Uber Usecase | Creately
Uber Usecase | Creately
End-to-End UML: Use Case Diagram
End-to-End UML: Use Case Diagram
Student Management Use Case
Student Management Use Case
AD