Class App

java.lang.Object
com.ntu.fdae.group1.bto.App

public class App extends Object
Main entry point for the BTO Management System application. Handles initialisation, the main application loop, and routing to user interfaces based on role.

This class implements the MVC architecture pattern by acting as the bootstrap component that connects controllers with views and manages the application lifecycle.

Version:
1.0
Author:
Group 1
  • Constructor Summary

    Constructors
    Constructor
    Description
    App(ControllerContainer controllerContainer, Scanner scanner)
    Constructs a new App instance with the specified controller container and scanner.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    main(String[] args)
    Main method that serves as the entry point for the BTO Management System.
    void
    run()
    Starts and runs the main application loop.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • App

      public App(ControllerContainer controllerContainer, Scanner scanner)
      Constructs a new App instance with the specified controller container and scanner. Initializes the login UI component.
      Parameters:
      controllerContainer - Container with all the application controllers
      scanner - Scanner instance for handling user input
  • Method Details

    • run

      public void run()
      Starts and runs the main application loop.

      This method controls the application's main lifecycle: 1. Displays a welcome message 2. Shows the main menu UI if no user is logged in 3. Routes logged-in users to their role-specific UI 4. Handles logout by resetting the current user 5. Performs cleanup when the application terminates

    • main

      public static void main(String[] args)
      Main method that serves as the entry point for the BTO Management System.

      This method: 1. Initializes all application components 2. Creates a Scanner for user input 3. Instantiates the App class 4. Starts the application by calling run() 5. Handles any critical initialization failures

      Parameters:
      args - Command line arguments (not used)