Sequence Diagram for the Airline Management System

Create a sequence diagram for reserving a flight in the airline management system and solve a challenge.

Sequence diagrams are a great way to understand the interactions between different entities and objects in the system. There can be different sequence diagrams that we can create for our airline management system. In this lesson, we will create sequence diagrams for the following two interactions:

  • Reserve a flight: The customer reserves a flight online.

  • Sequence challenge: The customer cancels a reservation.

Reserve a flight

The sequence diagram for reserving a flight should have the following actors and objects that will interact with each other:

  • Actor: Customer

  • Objects: SearchCatalogFlightReservationFlightSeat, and Payment

  • System

Here’re the steps in the reserve flight interaction:

  1. The customer searches for flights flying from an airport on a particular date.

  2. The catalog returns a list of flights that satisfy the search query.

  3. The customer selects a flight.

  4. If seats are available:

    1. The system requests the customer to select seats.

    2. The customer selects a seat.

    3. The system requests to add passenger details.

    4. The customer adds passenger details.

    5. The system creates a reservation for the customer.

    6. Payment is requested against the reservation.

    7. The customer initiates a transaction, and the payment is processed.

    8. If the payment is successful:

      1. The customer and system are informed that the payment is successful.

      2. The system updates the seat status to booked.

      3. The system updates the reservation status to confirmed.

      4. The reservation details are sent to the customer.

    9. Else, if the payment is unsuccessful:

      1. The customer is informed that the payment has failed.

  5. Else, if seats are unavailable:

    1. The customer is informed that no seats are available.

Note: We assume that the customer performs a valid search that will result in a list of flights.

Based on the order above, the sequence diagram for reserving a flight in the airline management system is given below.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.