How 2thuancr/fashionshopmanagement works
Main Components
• API Layer: In the “API” folder, you have an ASP.NET (or similar) web service exposing endpoints via controllers (AccountController, AuthController, etc.) for RESTful interactions.
• GUI (Presentation Layer): Under the “GUI” folder, there is a Windows Forms desktop application with multiple forms (fLogin, fHome, fDonHang, etc.) that serves as the main user interface.
• Business Layer: The “ServiceBUS” folder contains business logic classes (AccountBUS, BillBUS, etc.) that encapsulate the core rules and processes.
• Data Access Layer: The “RepositoryDAO” folder implements data access objects (DAO) that communicate directly with the database.
• DTO Layer: The “DTO” folder holds data transfer objects used to communicate data across layers.
• Shared Utilities: Under the “Shared” folder, there are common helper classes (Logger, MailHelper, Converter, etc.) that provide cross-cutting functions.
• Database: The “Database” folder includes the database backup files, SQL scripts, ERD image, stored procedures, triggers, and functions that define the persistence layer.
Relationships Between Components
• The GUI and API layers act as the two frontends. The GUI will interact with the ServiceBUS (business layer) via the RepositoryDAO (data access layer) or may consume data through DTO objects.
• The API layer provides services (likely RESTful) that encapsulate business logic operations. It too will interact with the ServiceBUS and then the RepositoryDAO.
• Both the ServiceBUS and RepositoryDAO layers work together: the ServiceBUS processes business rules and uses the RepositoryDAO to perform data operations.
• DTOs facilitate communication between these layers, ensuring that data models are consistent and decoupled from underlying database schemas.
• The Shared library supports all these layers with common functionality such as logging, email operations, and data conversions.
• The Database is the persistent storage component, and its structure is detailed by the ERD provided in the README.
Key Architectural Patterns & Principles
• Layered Architecture: The clear separation into Presentation (GUI/API), Business, Data Access, and Model (DTO) layers.
• MVC-like Pattern in API: Controllers in API indicate an MVC pattern, where command routing and handling are clearly defined.
• Separation of Concerns: Each layer focuses on a distinct responsibility, making the system modular and maintainable.
• Utilization of shared utilities to avoid redundancy and foster reuse.
Additional Elements
• Optionally, you may add annotations near the database part to call out the existence of triggers, stored procedures, and functions that enforce business rules at the persistence level.