How henipatel1009/ruburger works
Main Components
• Application Entry Point: Main.java initiates the program.
• Models: Classes under the model package (e.g., Burger.java, Sandwich.java, Combo.java, Beverage.java, AddOns.java, etc.) represent the data and business logic for menu items, order details, and price calculations.
• Controllers: Classes under the controller package (e.g., MainController.java, CurrentOrderController.java, AllOrdersController.java, BeverageController.java, BurgerController.java, ComboController.java, SandwichController.java, SideController.java). These act as the intermediaries between the user interface and the business logic.
• Views: FXML files in the resources directory (e.g., MainView.fxml, CurrentOrderView.fxml, AllOrdersView.fxml, etc.) handle the UI, with CSS styling and images provided in the resources folder.
• Tests: JUnit tests (e.g., SandwichTest.java and BurgerTest.java) ensure that the pricing and business logic work as expected.
• External Dependencies: JavaFX (for UI) and JUnit 5 (for testing) are essential technologies.
Relationships and Interactions
• Data Flow:
• The Main.java entry point launches the application, triggering the initialization of controllers and loading associated FXML views.
• Controllers respond to user actions (usually via pop-up dialogs) and communicate with the model classes to create, customize, and manage orders.
• The view layer (FXMLs) is connected to controllers, and data is rendered dynamically via JavaFX components.
• MVC Communication:
• Controllers retrieve and update data from models.
• Views capture user input through dialogs and pass requests to controllers.
• The model layer processes business logic including dynamic price calculation and order management.
Architectural Patterns and Design Principles
• MVC Pattern: Clearly segmented into model (data and business logic), view (FXML, CSS, images), and controller (event handling and UI control).
• Layered Architecture: Logical separation between user interface, business logic, and testing.
• Testing Suite: Use of JUnit tests indicates a commitment to unit testing for validating core functionalities (like price calculations).
Additional Elements
• A component for external libraries: Illustrate the role of JavaFX (UI framework) and JUnit 5 (testing framework).
• Top - Controller Layer: Encompass all controller classes.
• Middle - Model Layer: Encompass all model classes and business logic.
• Bottom - View Layer: Include the FXML files, images, and CSS styling.
• From Main.java (placed at the top or in a central “Entry Point” node) to the controllers.
• From each controller to its corresponding model classes.
• From controllers to the FXML views to indicate user interface updates.