How hloc26/project-dbms works
Based on our analysis of both the file tree and the README file, this project is a Windows Forms-based bookstore management system built using C# with Visual Studio 2022 and backed by Microsoft SQL Server. Its primary purpose is to streamline the management of employees, inventory (books and stationery), and customers, including membership programs.
• User Interface (Presentation Layer): This covers all Windows Forms (e.g., FLogin, FMain, FKhachhang, FRegis, FThemTTSach). These forms are responsible for user interaction such as login, registering users, and managing transaction interfaces.
• Data Access Layer: Represented by the DAO classes (e.g., EmployeeDAO, HangHoaDAO, HoaDonBanDAO, HoaDonNhapDAO, KhachHangDAO, ThemTTSachDAO, TraCuuDAO). This layer abstracts the underlying database operations.
• Domain/Data Models (DTOs): The DTO directory (for instance, Employee, HangHoa, KhachHang, NXB, Sach, TacGia, TheTV, VatPham) encapsulates the data transferred between the UI and DAO layers.
• Business/Logic Layer (if implicit): While business logic might be interleaved in the UI code or in additional service classes, note that the data flow starts from the UI, passes through the DAO and possibly some business logic embedded in forms.
• Database Layer: The backend SQL Server database, with its schema, stored procedures, triggers, views, functions, and scripts provided in the “DB Scripts” folder. Include the “FullScript.sql” as the central script to create and initialize the database.
• Configuration: The App.config file (inside DBMS_BookStore) which holds configuration settings like the database connection string.
Detail the relationships and interactions
• The User Interface sends user inputs (login requests, customer/data management operations) to the underlying Data Access Layer.
• The DAO classes use the database connection (configured in App.config and implemented via DBConnection.cs) to execute SQL commands, queries, stored procedures, and so forth.
• Data results are passed back to the UI using DTO objects.
• The SQL scripts indicate that business rules (triggers, views, procedures) exist in the database to enforce data integrity and advanced operations.
Architectural patterns and design principles
• Layered Architecture: The project clearly adheres to a layered architecture separating presentation, data access, and data models.
• Separation of Concerns: UI, DAO, and DTO directories indicate a clear separation between the user interface logic, database access logic, and data representation.
• Configuration Management: Use of App.config demonstrates how external configuration is used to decouple code and environment settings.
Technologies, frameworks, and libraries
• Programming Language: C#
• Application Framework: .NET Framework for Windows Forms
• Database: Microsoft SQL Server
• Development Environment: Visual Studio 2022
• Tools: SQL Scripts for schema and data initialization (including procedures, triggers, views, etc.)