How mthang1201/webook works
Project Overview & Main Components
• Project Type & Purpose:
– WeBook is a desktop library management application built using Java and JavaFX.
– It supports functionalities such as CRUD operations, authentication, suggestions, notifications, and comments.
– It connects to a MySQL database for persistent storage.
• Main Components to Represent:
– User Interface (UI) Layer:
▪ JavaFX views defined by FXML files (in src/main/resources/org/uet/library_management/ui and subdirectories)
▪ Controllers managing UI logic (located in src/main/java/org/uet/library_management/ui and its subpackages such as auth, admin, search, settings)
– Core Business Logic Layer:
▪ Core entities (e.g., Book, Thesis, User, Loan, etc.) found in src/main/java/org/uet/library_management/core/entities
▪ Services that perform business operations generally found in src/main/java/org/uet/library_management/core/services
▪ Repositories handling data access, including MySQLRepository and specific document repositories (in src/main/java/org/uet/library_management/core/repositories)
– API and Utility Components:
▪ API packages for search, sort, and image handling that abstract functionalities like searching and thumbnail generation (under src/main/java/org/uet/library_management/api)
▪ Utility and tool classes (e.g., SessionManager, Mediator, ImageCacheManager) used to facilitate miscellaneous support tasks.
– Database & Connectivity:
▪ ConnectJDBC.java handles MySQL connection setup
▪ The README instructs setting up MySQL with provided SQL dump files located in the resources/data directory.
– Testing Layer:
▪ The tests directory (src/test) contains unit tests verifying components like the JDBC connection, API methods, and core services.
Relationships & Interactions
– The UI Layer interacts with the Controllers, which in turn call services from the Core Business Logic.
– The Services interact with the Repositories for CRUD operations against the MySQL database.
– The API modules (search, image, sort) integrate with both the UI (to provide dynamic content and search suggestions) and the core layer (providing specialized functionalities).
– Utility classes support various layers, for example, session management and layout utilities that are accessed by controllers.
Architectural Patterns & Design Principles
• Layered Architecture:
– Present the system as several layers (UI, Business Logic, Data Access, and Utilities) to emphasize separation of concerns.
• Modularization:
– Highlight the modular approach by drawing separate blocks for API services (search, sort, image) and showing their roles in extending core functionalities.
• MVC-ish Approach:
– Even though it is desktop and not web-based, note the division between controllers (handling user interactions), FXML UIs (views), and underlying model entities.
• Dependency Injection / Loose Coupling:
– Indicate how services depend on repositories and APIs, showcasing potential use of dependency injection in managing these relationships.
Technologies and Frameworks
• JavaFX for UI components
• MySQL as the persistent storage (connectivity via ConnectJDBC)
• Maven as the build and dependency management tool
• Integration of third-party tools such as Lombok (for boilerplate reduction)
• Testing frameworks (likely JUnit or equivalent, as seen in the testing directories)