How riiichan04/flightticketmanagement works
Main Components
• Model Layer – Contains business logic and data representations. This includes classes for flights, accounts, tickets, filtering (e.g., AmountFilter, BrandFilter, DateFilter), and strategies (FlightStrategy). All these are under the “src/model” directory.
• View Layer – Manages the user interface. It’s composed of panels and frames (e.g., AccountPanel, FlightPanel, SignInFrame) in “src/view”. This layer is responsible for displaying flight lists, account information and allowing user interactions.
• Controller Layer – Found in “src/controller”. The Controller.java (and the IController.java interface) acts as a central dispatcher that connects UI actions (from the View) to business operations (in the Model).
• Data Storage – The “src/data” directory contains text files representing persistent storage for accounts and flight details. The flight details are segmented in text files with a defined format.
• Utilities – A supporting library of helper classes such as FileLoader, FileConverter, FontLoader, and JDialogCreator in “src/utilities”, used by various parts of the application.
• Assets – UI resources including fonts, images, and screenshots (helpful for UI design reference) in “src/asset.”
Relationships and Interactions
• The View interacts with the Controller through event handling. For example, user actions on a SignInPanel trigger events that the Controller processes.
• The Controller, acting as the middleman, calls methods on the Model to, for example, add, update, or retrieve flight and account information.
• The Model includes communication with the Data layer, reading and writing from txt files to maintain persistent state.
• Utility classes are used by both the Model (for tasks such as file conversion or loading) and the View (for generating dialog windows or custom labels).
• Some design patterns are evidenced: the Observer pattern (with the Observable class in the model and Observer interface in the view), and a Decorator pattern (as indicated by TicketDecorator).
Important Architectural Patterns
• MVC Architecture – Clear separation of concerns between UI (view), business logic (model), and request handling (controller).
• Observer Pattern – Ensures that views updating can be synchronized with changes in the model.
• Possibly a Decorator Pattern – Used to modify or extend the behavior of ticket processing.
• Layered Interaction – Data (files) connect to Model, then flow to Controller and out to the UI in the View layer.
Technologies and Frameworks
• Java – Core language running the application.
• Standard Java Swing (implied by frame and panel classes) for the UI.
• Basic file I/O operations for data persistence.
• Custom utilities for common tasks such as converting file data and loading resources.