How xuanlockun/meovivu works
Main Components
• Presentation Layer: Represented by the GUI components found in the “SourceCode/src/dulich/View” folder (e.g., LoginForm, Main, TourForm, Profile, etc.). Also include custom Swing components (like those within “SourceCode/src/dulich/Swing” – e.g., CustomTable, PlaceholderText, RoundJPanel) that enhance the UI.
• Business Logic Layer: Although not explicitly separated, some business logic might be embedded in the View classes and possibly in the “Model” directory (e.g., DataAccess.java). This DataAccess component is essential as it acts as the interface to the database, managing CRUD operations.
• Data Access Layer (Persistence): Encapsulated by “SourceCode/src/dulich/Model/DataAccess.java” and supported by the provided SQL script (meovivu.sql). Mention the JDBC integration (using ojdbc11.jar) as a bridge between the application and the underlying database.
• External Services & Libraries: Include components for:
• OpenWeatherMap API integration (as indicated by the README instruction to add an API key in the main form).
• Report Generation: Use of iTextpdf (from lib/itextpdf.jar) to generate PDF reports, and the existing PDF reports in “SourceCode/reports” as examples/result artifacts.
• Charting: jFreeChart (referenced by lib/jfreechart-demo-1.5.2-jar-with-dependencies.jar) to create visual data representations.
• JSON Parsing: Using json-simple (lib/json_simple.jar) for handling JSON data.
Depicting Relationships and Interactions
• Data flow from the Data Access layer to the Database, ensuring you indicate that JDBC (via ojdbc11.jar) is the connecting technology.
Architectural Patterns and Design Principles
• Although it’s a desktop application, highlight the separation of concerns by illustrating the UI components (Java Swing forms and custom components) separately from business logic and data access functionality.
• Modularity by showing that each UI screen (such as Login, Main, Profile, Tour forms) interacts with a central data access layer.
• That external dependencies (database connection, external API) are abstracted away through JDBC and specific library calls.
Detailed Step-by-Step Guidance
b. Next, create a “Business Logic / Controller” section. Since much of the logic is embedded in the view and model files, indicate the “DataAccess” component here.
• “OpenWeatherMap API” (annotate that communication happens via json-simple for JSON and requires an API key).
• “Report Generation Tools” with sub-nodes indicating iTextpdf and jFreeChart.
• From UI → Business Logic: User actions triggering data retrieval or report generation.
• From Business Logic → Database: Data operations via JDBC.
• Data retrieval flows: External API responses feeding back into the UI or report generation.