Package Common

Class AppManager

java.lang.Object
Common.AppManager
Direct Known Subclasses:
AdminAppMgr, DoctorAppMgr, PatientAppMgr, PharmaAppMgr

public abstract class AppManager extends Object
The AppManager class serves as an abstract base class for managing application-level functionalities. It provides methods for user login/logout, database management, and common settings across different roles.
  • Field Details

  • Constructor Details

    • AppManager

      public AppManager()
  • Method Details

    • logIn

      public void logIn(Account account)
      Logs in the specified account and initializes the application state.
      Parameters:
      account - the Account object representing the user logging in
    • logOut

      public void logOut()
      Logs out the current user and saves any changes made to the databases.
    • getRole

      public Role getRole()
      Returns the role of the currently logged-in user.
      Returns:
      the Role of the current user
    • settings

      protected void settings()
      Displays settings options for updating user details.
    • createManagers

      protected abstract void createManagers()
      Creates instances of managers specific to the application context. This method must be implemented by subclasses to define manager creation.
    • createPages

      protected abstract void createPages()
      Creates instances of pages specific to the application context. This method must be implemented by subclasses to define page creation.
    • loadDatabases

      protected abstract void loadDatabases()
      Loads necessary databases for managing application data. This method must be implemented by subclasses to define database loading.
    • saveDatabases

      protected abstract void saveDatabases()
      Saves changes made to databases back to their respective CSV files. This method must be implemented by subclasses to define database saving.
    • displayMainPage

      public abstract void displayMainPage()
      Displays the main page of the application, providing access to various functionalities.