Package com.ntu.fdae.group1.bto
Class App
java.lang.Object
com.ntu.fdae.group1.bto.App
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
ConstructorsConstructorDescriptionApp
(ControllerContainer controllerContainer, Scanner scanner) Constructs a new App instance with the specified controller container and scanner. -
Method Summary
-
Constructor Details
-
App
Constructs a new App instance with the specified controller container and scanner. Initializes the login UI component.- Parameters:
controllerContainer
- Container with all the application controllersscanner
- 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
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)
-