Airline Management System
Requirements
As a Customer
- customer should be able to search flights
- customer should be able to book , cancel or modify a reservation
- Customer should be able to select a seat.
- make a payment
As an Admin
- Change the flight schedule / itinerary
- assign pilot and crew.
- cancel a flight.
As a front desk officer
- Should be able to book , cancel or modify a reservation.
Workflow
- Customer logs in
- Enter details like source, destination, date, time
- Gets list of flights
- Selects a flight
- Selects a seat
- Makes reservation
- Does payment
- Gets notification.
Classes and methods
Airport.java
public class Airport {
String airportName; // for eg: SeaTac, Sky Harbor, Charles Douglas;
String address;
String uniqueAirportId; // for each airport
}
Airline.java
public class Airline {
String airlineName; //Alaska, American, Delta
String airlineCode; //1,2,3
}
Aircraft.java
public class Aircraft {
String manufacturer; //boeing, airbus
String model; //737, A300
String yearsInService;
String lastService;
String manufacturingDate;
}
Flight.java
public class Flight {
String flightNumber;
String source;
String destination;
String departureTime;
String expectedArrivalTime;
Aircraft assignedAircraft; //each flight will be an instance so a flight from seattle to london at a paricular time is 1 instance of flight
Airport airport;
boolean addFlightSchedule() {...} //information like source destination date time etc.
void updateStatus(FlightStatus flightStatus) {...} //update the status of the flight
boolean cancel() {...} // cancel the flight.
}
FlightReservation.java
To pull out the reservation of the entire flight
/*To pull out the reservation of the entire flight*/
public class FlightReservation {
Flight flight;
String reservationNumber;
Map<Passenger, Seat> seatMap;
ReservationStatus reservationStatus;
public List<Passenger> getPassengers() {...}
public FlightReservation getFlightReservation(String reservationNumber) {...}
}
Seat.java
Class to assign seats to passengers for a particular flight instance.
/*Class to assign seats to passengers for a particular flight instance.*/
public class Seat {
String seatFare;
String seatType;
String seatNumber;
public float getFare() {...}
}
Itinerary.java
Both the customer and front-desk can use the itinerary class to book/ cancel/ update the reservation.
/*
Both the customer and front-desk can use the itinerary class to book/ cancel/ update the reservation.
*/
public class Itinerary {
String customerId;
Airport startingAirport;
Airport finalAirport;
Date creationDate;
List<FlightReservation> reservations;
public List<FlightReservation> getReservations();
public boolean makeReservation();
public boolean makePayment();
}
Payment.java
public class Payment {
String paymentId;
PaymentMode paymentMode;
PaymentStatus paymentStatus;
boolean makeTransaction() {...}
}
Notification.java
public class Notification {
String notificationId;
NotificationMode notificationMode;
NotificationStatus notificationStatus;
}
we will use enum class for all the Status like PaymentStatus
, NotificationStatus
, ReservationStatus
etc.