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
-
Method Summary
Modifier and TypeMethodDescriptionstatic FlightBookingSystem
load()
Loads the flight booking system data.static void
store
(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
FlightBookingSystem
and populates it with data from all registeredDataManager
instances.- Returns:
- a fully populated
FlightBookingSystem
instance - 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
FlightBookingSystem
instance and saves its data using all registeredDataManager
instances.- Parameters:
fbs
- theFlightBookingSystem
instance to store- Throws:
IOException
- if there is an I/O error during the storing process
-