A use case diagram is one of the 14 different types of diagrams that exist with the Unified Modeling Language (UML). So, if you are using it in your project, there is a high chance that you must create a use case diagram. In this case, you may need a use case diagram example that will show you all the elements and components that you need to include.
In this article, you’ll learn all basics about a use case diagram and 8 excellent use case diagram examples. Keep reading!
What Is Use Case Diagram
Before we get into the examples though, it is important to briefly explain what a use case diagram is. This type belongs to the behavioral diagram of UML because it notes all the ways that users can interact with the system. Therefore, a use case diagram example includes all possible user types (or actors) and their use cases. This clearly establishes the connection between them, as well as other extended connections.
Use Case Diagram Components
After learning the role of a use case diagram, you must learn all about its components. As in every other diagram type, a use case diagram has some specific notations and shapes that indicate each element. Therefore, to understand a use case diagram example, you must know what each shape represents so that you create something that all your colleagues will understand.
The components that you must encounter in a use case diagram example are the following:
#1 System Boundaries
Each system has a predefined boundary and this element shows that on the diagram. Moreover, this component can also be used to indicate the system’s different functions, especially if they are targeting different actors. You can show the system boundary on your use case diagram with a rectangular shape.
The truth is that a single system might have many different user types. All of these are referred to as actors in a use case diagram. To add an actor to your diagram, you must create a small stick figure.
#3 Use Cases
This element is at the heart of this diagram. In reality, it is the component that stands for the separate functions of the system. You can add a use case element with an oval shape.
At this point, we also need to mention the include and extend relationships that some use cases have. An include is a relationship that shows that a use case is mandatory, as well as part of another use case. An exclude is a relationship that indicates that the use case is option and will take place after the initial use case.
#4 Communication Links
This element is what brings actors and use cases together. A communication link connects each actor with the appropriate use cases. Note that all actors should be connected to at least 1 use case. However, there is a possibility that there will be use cases that stand on their own. You can add a communication link with a line.
8 Use Case Diagram Examples
Below, we will go through some examples for different types of systems so that you find a use case diagram example that meets your requirements.
The first use case diagram example is about a restaurant system. As you can see in the diagram, a restaurant has four actors, which are the waiter, the client, the chef, and the cashier.
The client’s main use cases are “order food”, “eat food”, and “pay for food”. As extended use cases, they can also “order wine”, “drink wine”, and “pay for wine”.
The waiter’s use cases are to “order food”, “serve food”, and “pay for food” since they are the one that facilitate the payment. If the client also orders wine, they also have the extended use cases of “order wine”, “serve wine”, and “pay for wine”.
The chef interacts with the use cases “order food” and “prepare food”. Finally, the cashier only accepts the payment, so their main use case is “pay for food”. In some cases, they also have the extended use case of “pay for wine”.
2. ATM Machine System
The next example depicts an ATM machine system. In this case, the actors are three, which are the operator, the customer, and the bank.
The operator has only two use cases that are the “system startup” and the “system shutdown”. The bank is the actor whose main use case is the “transaction”. As you can see, the transaction use case includes several other use cases. These are the “withdrawal”, the “deposit”, the “money transfer”, and the “inquiry”. The customer also has the use case of “transaction”, with all the other inclusions. In addition to this, there is also a use case extension for the “invalid PIN code”.
Online Shopping System
The following example has multiple actors, such as the website user, the system authentication, the identity provider, as well as the payment services (for example a credit card service).
As it’s depicted, the website user can be a new user or a returning user. The user interacts with the use cases “view items”, “make a purchase”, and “client register”. Checkout is an included use case for this actor.
The system authentication interacts with the use cases “view items”, “client register”, and “checkout”. The identity provider has the use cases “view items” and “checkout”, while the payment services only interact with the use case “checkout”.
Railway Reservation System
In the following use case diagram example, we are depicting an online railway reservation system. In this case, there are three main actors, the traveler, the railway website, and the clerk.
The railway website has the “check ticket availability”, “pay fare amount”, “book ticket”, “fill out personal information and travel details”, “cancel ticket”, and “refund money” use cases. The “book ticket” has an include relationship with the “pay fare amount” use case. The “fill out personal information and travel details” has an include relationship with the “book ticket” and “cancel ticket” use cases. Finally, the “cancel ticket” use case has the inclusion of “refund ticket”.
The traveler interacts with the “check ticket availability”, “pay fare amount”, “book ticket”, “fill out personal information and travel details”, and “cancel ticket” use cases. The clerk has only the “cancel ticket” use case.
Airport Check-in System
In this example, we showcase an airport check-in system. In this diagram, we have the passenger and the tour guide as the main actors. As it becomes obvious from the example, a tour guide is related to the passenger.
The passenger has the top-level use cases of “individual check-in” and “security screening”., The individual check-in can have the extension use case of “baggage check-in”. When it comes to the tour guide, they have the use case “group check-in”, which has an include relation with the “individual check-in” use case.
Travel Agency System
The next example shows you a use case diagram for a travel agency system. In this diagram, we have the customer, the airline company, the travel agent, and the touring company as actors.
The customer has the use cases “book airline tickets” and “pay travel agent”. The “book airline tickets” has the use case extensions of “book a tour”, while the “pay travel agent” has an include relationship with “pay for airline tickets” and “travel agent commission” use cases.
The travel agent has the use cases “book airline tickets”, "deliver airline ticket” and “pay travel agent”. As you see the extend and include relationship for the “book airline tickets” and “pay travel agent” use cases are the same. The “deliver airline ticket” also has an extend relationship with the “arrange tour” use case.
The airline company has the use cases “Book airline ticket”, “reserve a seat”, and “pay for airline ticket”, which has all the include and exclude relationships that we have seen. Finally, the touring company has the use cases “arrange tour” and “pay for tour”.
Hospital Management System
In reality, a hospital management system consists of several modules. However, we are only focusing on one to make the example easier to follow. In this example, we are examining the reception of the hospital. Therefore, the main actor is the receptionist.
This particular actor has many responsibilities and we can see that in the diagram. They have “patience registration”, “patient hospital admission”, “schedule patient appointment”, “schedule patient hospital admission”, “file insurance forms/claims”, and “file medical reports” as their main use cases.
You can see that the “patient admission” has an “include” relationship with the “patient registration” use case. Moreover, the “outpatient hospital admission” and “inpatient hospital admission” are a part of this use case, in which the last one also has an include relationship with the “bed allotment” use case.
Similarly, the “patient registration” has the “schedule patient appointment” and “schedule patient hospital admission” use cases as extensions .
User Management System
The final use case diagram example is that for a user management system. In this particular system, you can see that there are three actors, which are the software process group, the process owner, and the user.
The software process group has the use cases of “personalize page” and “set member group”. . On the other hand, the user has only “personalize page” as their use case. The process owner has the use cases “set asset protection” and “change process owner”. As you can see in the example, the process owner directly related to the software process group.
How to Draw a Use Case Diagram
After finding the right use case diagram example for your system, you can create it in Boardmix. This online whiteboard tool makes diagramming easier as it brings you all the tools that you need. For instance, you can directly use the use case diagram template in the template center. This way, you will have a base to work on and make the process faster and more effective. Or if you want to start from scratch, you can find all shapes needed for designing UML diagrams in the shape library.
Here is how to use Boardmix to create a use case diagram:
01. Select the use case diagram template from the template center on Boardmix. Right now, the tool offers you an library including all the diagrams you might need to create.
02. Then, identify and create all actors and use cases. If you are working on a template, you add or remove additional elements depending on your system’s functions.
03. Connect the actors to the corresponding use cases. You can either add straight lines or arrows.
04. Your use case diagram is ready. Boardmix makes it easy for you to share it with your colleagues and managers. The only thing you have to do is share the link and they will access the diagram directly.
All of the use case diagram examples show you how you can use this diagram to boost the efficiency of your system. And you can also use Boardmix to take advantage of its numerous templates that make diagramming faster and easier than ever before.