How int710/managestudentgrade works
Project type and purpose
• The project is a desktop-based student score management system developed in Java using Swing for its GUI.
• Its core functionality includes user authentication (with role-based access for Admin/Student), management of student grades (adding, updating, deleting, and searching), password changes, and exporting reports to PDF.
• The backend relies on a MySQL database, and external libraries such as itextpdf and mysql-connector are used for PDF generation and database connectivity respectively.
File structure
• The project is structured into multiple layers under the "src/studentmanagementpoint" package.
• Key directories include:
• /views: Contains Java Swing forms and corresponding Java classes that define the user interface (Login, HomeAdmin, ChangePassword, Student, etc.).
• /service: Contains service classes (e.g., UserService, TeacherService, ClassService, GradenService, ResultService) which hold business logic and orchestrate operations between views and the database.
• /dto: Contains Data Transfer Objects (like StudentModel, GradeModel, StudyResultModel) that represent the data structures used across the system.
• /config: Contains configuration classes for connecting to MySQL including MySQLConnection.java and testConnectDB.java.
• /utils: Includes utility classes for common tasks such as password handling, date conversion, PDF exporting (ExportToFilePDF), and session management.
• /assets: Houses static resources such as fonts and images used by the UI.
• Additionally, there’s an SQL file (init_sql.sql) to initialize the database schema and provided libraries within the /libs folders.
README for additional insights
• The README clearly outlines the project’s features, required technologies, and the intended use cases.
• It briefly explains the user flows (login, change password, manage scores, view student grade details) and emphasizes the use of Java Swing for the frontend and MySQL for database backend.
• The provided README also mentions the inclusion of PDF generation via itextpdf, which is critical for the reporting functionality.
Defining the main components
a. Main Components:
• User Interface / Presentation Layer: Represented by the various Swing forms in the "views" directory.
• Business Logic / Service Layer: The "service" directory which encapsulates all business rules and data processing logic.
• Data Model / DTO Layer: Represented by the DTOs that carry data between layers.
• Configuration / Database Layer: Includes database connection classes from "config" and the MySQL database setup itself, shown through the SQL initialization script.
• Utility Components: Such as PDF export functionality and session management.
• External Libraries: itextpdf for PDF rendering and mysql-connector for MySQL connectivity.
b. Relationships and Interactions:
• The GUI layer (views) interacts with the service layer to trigger business operations.
• Services use DTOs to pass data between the UI layer and the database.
• The config components (MySQLConnection) manage the connection to the MySQL database where data is stored.
• Utility classes are used by both the service layer and the views to perform common operations (e.g., formatting dates, handling passwords).
• External libraries are integrated into the application wherever needed (e.g., PDF exporting in the ExportToFilePDF utility).
c. Architectural Patterns and Design Principles:
• Layered Architecture: Separates UI, business logic, data transfer, and configuration.
• Separation of Concerns: Each module (views, service, dto, utils, config) is responsible for a distinct aspect of the application.
• Dependency Management: Clearly outlines dependencies such as libraries and external database services.
Final Advice
• Think in terms of layers: Start from the UI layer (views), move to the service (business logic), then to data transfer (DTOs), and finally to database connectivity and external libraries.