Package bcu.cmp5332.bookingsystem.data
Class FlightBookingSystemData
java.lang.Object
bcu.cmp5332.bookingsystem.data.FlightBookingSystemData
The
FlightBookingSystemData class is responsible for loading and storing
the flight booking system data. It uses multiple DataManager instances
to manage different aspects of the data.
This class contains static methods to load and store data for the
FlightBookingSystem. The data managers are initialized when the
class is loaded into memory.
Note: The CustomerDataManager and BookingDataManager
are included in the list of data managers but their loadData()
and storeData() methods need to be implemented.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FlightBookingSystemload()Loads the flight booking system data.static voidstore(FlightBookingSystem fbs) Stores the flight booking system data.
-
Constructor Details
-
FlightBookingSystemData
public FlightBookingSystemData()
-
-
Method Details
-
load
Loads the flight booking system data.This method creates a new instance of
FlightBookingSystemand populates it with data from all registeredDataManagerinstances.- Returns:
- a fully populated
FlightBookingSysteminstance - Throws:
FlightBookingSystemException- if there is an issue with loading the dataIOException- if there is an I/O error during the loading process
-
store
Stores the flight booking system data.This method takes a
FlightBookingSysteminstance and saves its data using all registeredDataManagerinstances.- Parameters:
fbs- theFlightBookingSysteminstance to store- Throws:
IOException- if there is an I/O error during the storing process
-