Flight Reservation System

Class Diagram

PassengerpassengerId: stringname: stringcontactInfo: stringFlightflightNumber: stringdepartureTime: datetimearrivalTime: datetimeFlightDescriptionroute: stringorigin: stringdestination: stringAirplaneserialNumber: stringmodel: stringSeatseatNumber: stringclass: stringBookingbookingId: stringstatus: stringmade by11reserves1111operated by11composed of1manyfollowsmany1

Description

Class diagram modeling the components of an airline booking system, including passengers, flights, and bookings.

Flight Reservation System

This class diagram models the components of an airline booking system. It's an interesting example because it involves entities with specific states and complex associations, like seats on a particular flight.

Core Classes:

  • Passenger: Contains passenger details like passengerId, name, and contact information.
  • Flight: Represents a specific flight route at a scheduled time, e.g., "Flight BA2490 from LHR to AMS". It has attributes like flightNumber, departureTime, and arrivalTime. It's an instance of a FlightDescription.
  • FlightDescription: A template for a flight route (e.g., the daily London to Amsterdam flight), containing the origin and destination airports.
  • Airplane: Represents the physical aircraft with a serialNumber and model. It has a collection of Seats.
  • Seat: A seat on an airplane, identified by a seatNumber (e.g., "21A") and class (e.g., Economy).
  • Booking: Represents a reservation made by a Passenger for a specific Seat on a specific Flight. It has a bookingId and a status (e.g., Confirmed, Cancelled).

Relationships:

  • A Booking is made by one Passenger (One-to-One Association).
  • A Booking reserves one Seat on one Flight.
  • A Flight is operated by one Airplane (One-to-One Association).
  • An Airplane is composed of many Seats (Composition).
  • Many Flights can follow the same FlightDescription.