Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
Purpose of Use Case Diagram 
3.
Notations For Use-Case diagrams
4.
Drawing A Use Case Diagram
5.
Example of a Use Case Diagram
6.
Applications Of Use Case Diagram
7.
FAQs
8.
Key Takeaways
Last Updated: Mar 27, 2024
Easy

UML - Use Case Diagram

Author Divyansh Jain
0 upvote

Introduction

A Use Case diagram represents the system's functionality and requirements. Use Cases represent the services, jobs, and functions that a system must provide. High-level functionalities and how a user would interact with the system are represented by use cases. The key ideas of Unified Modeling linguistic modeling are use-cases. The most crucial part of modeling a system is capturing the dynamic behavior. The behavior of a system when it is running/operating is referred to as dynamic behavior.

To model a system, static behavior alone is insufficient; dynamic behavior is more significant than static behavior. One of the five diagrams available in UML to depict the dynamic nature is the use case diagram. Now that we've discussed that the use case diagram is dynamic, there should be some internal or external factors that influence how it interacts.

Actors refer to both internal and external agents. Actors, use cases, and their relationships are depicted in use case diagrams. The diagram is used to represent an application's system or subsystem. A single-use case diagram depicts a system's specific capabilities.

As a result, a variety of use case diagrams are utilized to model the overall system.

Purpose of Use Case Diagram 

The objective of the use case diagram is to capture a system's dynamic nature. However, this description is too broad to adequately characterize the objective, given the purpose of the other four diagrams (activity, sequence, cooperation, and Statechart) is similar. We'll look into a specific purpose that sets it apart from the other four diagrams.

The needs of a system, including internal and external factors, are gathered via use case diagrams. The majority of these requirements are design-related. As a result, use cases are generated and actors are identified when a system is studied to gather its functionality.

Use case diagrams are modeled to give the outside view once the first work is completed.

In a nutshell, the following are the goals of use case diagrams:

  • Used to collect a system's requirements.
  • To acquire a bird's eye view of a system.
  • Determine the external and internal influences on the system.
  • Demonstrate the interaction between the requirements and the actors.

Notations For Use-Case diagrams

The notations used in a use case diagram are as follows:

Use Case

High-level functionalities and how the user will interact with the system are represented by use cases. A use case describes a specific feature of a system, component, package, or class. It's represented by an oval shape with the name of a use case written inside. The following is the UML notation for a use case:

UML Use Case Notation

Actor

It appears in use case diagrams. The actor is a component of the system that interacts with the system. The best example of an actor is a user. An actor is a person or thing that starts a use case from outside its scope. It can be any aspect that can cause the use case to interact with it. Multiple-use cases in the system can be linked to a single factor. The UML actor notation has been below.

Actor-Name


Also read about  V Model in Software Engineering

Drawing A Use Case Diagram

Use cases are nothing more than the system's functionality laid down in a logical order. The actors are the second factor to consider in use cases. The term "actor" refers to anything that interacts with the system. Human users, internal apps, or external applications can all be used as actors. The following components should be identified before we start drawing a use case diagram.

Functionalities are represented as: 

  • Use-case
  • Actors
  • Relationships of use cases and actors.

Use case diagrams are used to represent a system's functional needs. After we've identified the above components, we'll need to follow the principles below to create an effective use case diagram.

  • A use case's naming is extremely significant. The name should be chosen in such a way that it can be used to identify the functions that have been completed.
  • Give the performers a suitable name.
  • The diagram clearly shows links and dependencies.
  • The main objective of the diagram is to establish the requirements; thus, don't try to include all forms of relationships.
  • Take notes if you need to clarify something crucial.

Important tips for drawing a Use Case Diagram

  1. A use case diagram should be as straightforward as possible.
  2. A use case diagram must be completed.
  3. All interactions with the use case should be represented in a use case diagram.
  4. If there are too many use cases or actors, only the most important ones should be represented.
  5. A use case diagram should describe at least one system module.
  6. The use case diagram should be generalized if it is large.

Example of a Use Case Diagram

A sample use case diagram for a library management system is shown below. There are four use cases(Registration Book Loan, Registration Book Return, Query Book availability, Add New Book) and two actors (Librarian and Library user) in the diagram.

In the above diagram there are four use cases and two types of actors(library user and librarian) these actors can perform certain functions based on the arrows that connect them and the use cases are in the System boundary that represents Library System. The actor librarian has the permissions to register Book Loan, Book returns, Query related to book availability and he can also add new books, whereas the Library user can Register for a book loan, Register Book Return, and Query for the availability of the book.

Applications Of Use Case Diagram

Now, let’s discuss various applications of use case diagrams:

  1. We need to employ many sorts of diagrams to comprehend the dynamics of a system. One of them is the use case diagram, which is used to collect system requirements and actors.
  2. Use case diagrams to describe the events and flows of a system. But use case diagram never describes how they are implemented. The use case diagram can be thought of as a black box, with only the input, output, and function of the black box known.
  3. These diagrams are used at the most advanced level of design. This high-level design is refined several times in order to obtain a complete and practical picture of the system. A well-structured use case describes the pre-condition, post-condition, and exceptions as well. When testing, these extra elements are used to create test cases.
  4. Although use cases are not good candidates for forwarding and reverse engineering, they are still used to perform forward and reverse engineering in a slightly different way. The same can be said for reverse engineering. To make it suitable for reverse engineering, the use case diagram is used in a different way.
  5. Use case diagrams are used in forwarding engineering to create test cases, and in reverse engineering to prepare the requirement details from the existing application.

FAQs

  1. Which requirements are taken into account in the use case diagram?
    Actors, use cases, and their relationships must be taken care of in use case diagrams. The diagram is used to model an application's system/subsystem. A single-use case diagram encapsulates a certain system functionality. As a result, a number of use case diagrams are employed in order to model the overall system.
     
  2. What are the most prevalent applications of a use case diagram?
    Use-case diagrams describe a system's high-level functions and scope. These diagrams also show how the system and its actors interact with one another. In use-case diagrams, the use cases and actors define what the system does and how the actors interact with it, but not how the system runs internally.
     
  3. What exactly is a secondary actor in a use case?
    In a use case, a supporting actor (also known as a secondary actor) is an external actor who offers a service to the system under design. It might be a high-speed printer, a web service, or personnel who must conduct research and respond to us.
     
  4. Why should customers bother reading use cases?
    Use cases illustrate a system's functional requirements from the perspective of the end-user, resulting in a goal-focused sequence of activities that is simple for users and developers to follow.
     
  5. What exactly is the distinction between a scenario and a use case?
    A use case is an abstraction that specifies all conceivable scenarios involving the feature being described. A scenario is a type of use case that describes a specific set of actions. Use cases are used to describe every feasible case; their emphasis is on completeness.

Key Takeaways

Now you have gained enough knowledge about the Use-Case Diagram and you can make the best possible diagram easily and without any problem. Also, we have gained exceptional tips to make Diagrams much better, and simultaneously, we also cleared the basic doubts regarding the process of making use of case diagrams. 

Hope you learned something. Don't stop here, Ninja; Also check out the State Diagram, Timing Diagram, Sequence Diagram, and many more on our platform to get hands-on experience with all the diagrams.

Happy Learning Ninja :)

Live masterclass