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 the basics about a use case diagram and 8 excellent use case diagram examples. Keep reading!
Try Use Case Diagram for FreeÂ
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 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.
2. Actors
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.
Try Use Case Diagram for FreeÂ
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 an 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.
Restaurant System
Try Use Case Diagram for FreeÂ
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 ones 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 system. In this case, the actors are three, which are the operator, the customer, and the bank.
The operator has only two use cases which 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
Try Use Case Diagram for FreeÂ
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 included relationship with the âpay fare amountâ use case. The âfill out personal information and travel detailsâ has an included relationship with the âbook ticketâ and âcancel ticketâ use cases. Finally, the âcancel ticketâ use case has the inclusion of a â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 included 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 included 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 a 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 extended 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 have all the includes and exclude relationships that we have seen. Finally, the touring company has the use cases âarrange tourâ and âpay for the 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 the last one also has an included 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 a âpersonalized 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 is 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 a 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.
In Conclusion
All of the use case diagram examples show you how you can use this diagram to boost the efficiency of your system. You can also use Boardmix to take advantage of its numerous templates that make diagramming faster and easier than ever before.