How nguyentuanninh/library-management-system works
Main System Components
• Presentation Layer (Frontend):
• Represented by the web directory which contains all JSP pages, HTML, CSS, JavaScript, and assets (images, styles).
• Pages like Login.jsp, Register.jsp, HomePageAdmin.jsp, HomePageUser.jsp, and other feature-specific pages (e.g., ListBook.jsp, Feedback.jsp).
• Controller Layer (Back-End Controllers):
• Located in src/java/controller. This layer includes classes like Login, CreateUser, CreateBook, UpdateBook, etc.
• Controllers process client requests, coordinate between the view and the business logic.
• Business Logic & Data Access Layer:
• This layer is divided into:
• Data Access Objects (src/java/DAO) which includes classes such as BookDAO, UserDAO, BorrowerDAO, etc.
• Entity classes (src/java/entity) that define the core business objects (Book, Borrower, Category, Feedback, User).
• These components encapsulate and enforce the business rules and data manipulation logic.
• Database Connection and Configuration:
• The package src/java/dbConnect includes DBContext and TestConnection classes, responsible for establishing connections with the SQL Server.
• The database folder holds the DBScript.sql, which is used to set up the database.
• Configuration & Deployment Files:
• Configuration details like MANIFEST.MF in src/conf and web.xml in web/WEB-INF.
• Build and project configuration files (build.xml, nbproject) that support project building and deployment.
Relationships and Data Flow
• How user interactions via the web layer (JSP pages) invoke requests that are routed to the appropriate Controller.
• How controllers call DAO methods to interact with the database.
• Role of JDBC within DAOs for executing SQL queries on the SQL Server database.
Architectural Patterns and Design Principles
• Modular design: Each package (controller, DAO, entity, dbConnect) represents a modular component. This modularity aids in maintainability and extensibility.
• Integration of external libraries: Note the inclusion of libraries such as JSTL (for JSP) and SQL Server JDBC drivers (in the lib folder).