Package bcu.cmp5332.bookingsystem.data
Interface DataManager
- All Known Implementing Classes:
BookingDataManager
,CustomerDataManager
,FeedbackDataManager
,FlightDataManager
public interface DataManager
The DataManager interface defines methods for loading and storing data
to/from a data source into a FlightBookingSystem instance.
The SEPARATOR constant defines the delimiter used to separate fields in the data source.
Implementing classes should provide implementations for the loadData and storeData methods to load data into and store data from a FlightBookingSystem instance, respectively.
Example usage:
// Create a new instance of FlightBookingSystem and DataManager implementation
FlightBookingSystem fbs = new FlightBookingSystem();
DataManager dataManager = new CustomDataManager(); // Replace with actual implementation
// Load existing data into FlightBookingSystem
dataManager.loadData(fbs);
// Perform operations on fbs...
// Store current data from FlightBookingSystem
dataManager.storeData(fbs);
- See Also:
-
CustomDataManager
FlightBookingSystem
SEPARATOR
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Loads data from a data source into the provided FlightBookingSystem instance.void
Stores current data from the provided FlightBookingSystem instance into a data source.
-
Field Details
-
SEPARATOR
The delimiter used to separate fields in the data source.- See Also:
-
-
Method Details
-
loadData
Loads data from a data source into the provided FlightBookingSystem instance. Implementing classes should define how data is read from the data source, parsed, and added to the FlightBookingSystem.- Parameters:
fbs
- The FlightBookingSystem instance to load data into- Throws:
IOException
- If there is an error reading the data sourceFlightBookingSystemException
- If there is an error parsing the data or updating the FlightBookingSystem
-
storeData
Stores current data from the provided FlightBookingSystem instance into a data source. Implementing classes should define how data is retrieved from the FlightBookingSystem and formatted for storage.- Parameters:
fbs
- The FlightBookingSystem instance to store data from- Throws:
IOException
- If there is an error writing data to the data source
-