Use Case Diagram for the Elevator System
Learn how to define use cases and create the corresponding use case diagram for the elevator system.
Let’s build the use case diagram of the elevator system and understand the relationship between its different components.
First, we will define the different elements of our elevator, followed by the complete use case diagram of the system.
System
Our system is an "elevator."
Actors
Next, we will define our elevator system’s main actors.
Primary actors
Passenger: This actor is the passenger in an elevator. It can request an elevator, open and close the door of an elevator, move up and down using the elevator, and press the emergency button.
Secondary actors
System: It can open and close the elevator door, display floor level, and move the elevator according to the dispatcher algorithm.
Use Cases
In this section, we will define the use cases for the elevator. We have listed the use cases according to their respective interactions with a particular actor.
Note: You will see some use cases occurring multiple times because they are shared among different actors in the system.
Passenger
Press elevator panel button: To press the button on the elevator panel to select the destination floor, request to open/close the elevator door while it is stopped, or call an emergency
Press hall panel button: To press the button on the hall panel to select the request for the elevator
System
Move/stop elevator: To move up or down or to stop the elevator on a specific floor
Dispatcher algorithm: For proper elevator functionality according to the algorithm
Display (inside/outside): To display the floor number on the screen inside and outside the elevator
Open/close door: To open and close the elevator door
There are some use cases that are not directly related to any actor. These are elaborated below
Request for elevator: To request the elevator
Floor request: To submit a request for the destination floor
Door open/close request: To submit a request to open/close the elevator door
Call Emergency: To call the support team in case of emergency
Relationships
This section describes the relationships between and among actors and their use cases.
Generalization
We can press the elevator panel button to select the destination floor, request to open/close the elevator door while it is stopped, or call an emergency. This demonstrates that the “Press elevator panel button” use case has a generalization relationship with “Floor request,” “Door open/close request,” and “Call emergency” use cases.
Associations
The table below shows the association relationship between actors and their use cases.
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.