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:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The delimiter used to separate fields in the data source.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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

  • 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 source
      FlightBookingSystemException - If there is an error parsing the data or updating the FlightBookingSystem
    • storeData

      void storeData(FlightBookingSystem fbs) throws IOException
      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