How surajkulriya/pharmacy-management-system works
Project Overview
• This is a full-stack desktop application built primarily in Java using Swing for the GUI, along with a MySQL back end (accessed via JDBC). It supports pharmacy operations such as user login, drug management, purchase/sales handling, invoicing, reporting, and messaging.
File Structure
• Notice the separation between the source Java files (in the src/main directory) and GUI form files (with “.form” extensions). This indicates strong coupling between the UI layer and the underlying Java classes.
• The existence of separate directories for build, dist, and lib suggests that the application is modularized into components that deal with the GUI, business logic, and external libraries (e.g., AbsoluteLayout.jar, JTattoo, MySQL connector).
• The “nbproject” and “build.xml” files hint at NetBeans usage, so the build process and dependency management are also part of the overall system architecture.
Identifying the Main System Components
a. User Interface (Presentation Layer):
• Composed of Swing-based Java forms (e.g., Login.form, Pharmacy.form, Drug_List.form, etc.).
• This layer handles user input, display of reports/invoices, and navigation between modules.
b. Business Logic Layer:
• Implemented in the corresponding Java classes (e.g., Login.java, Drug.java, Sales_Bill.java).
• Handles the core operations like business rules, validations, processing of transactions (e.g., drug purchase, sales, user management, messaging).
c. Data Access Layer:
• Although not explicitly separated into a package, connection handling is present in classes like Connect.java.
• This layer is responsible for communicating with the MySQL database (using the mysql-connector-java provided in lib).
d. Database (Persistence Layer):
• The MySQL database, which is set up using the provided “pharmacy.sql” file.
Relationships and Interactions
• Users interact with the GUI, which in turn passes requests to the Business Logic Layer.
• The Business Logic Layer uses the Data Access Layer to perform CRUD (Create, Read, Update, Delete) operations on the Database.
• Additionally, consider including error paths and possibly periodic data refresh cycles (e.g., for stock updates, messaging modules).
Architectural Patterns and Design Principles
• The project appears to follow a multi-tiered architecture separating the presentation, business, and persistence concerns.
• MVC-style separation is evident since the Swing forms (UI) are separate from the business logic implementations.
• That the design ensures modularity so that any changes to the GUI or database access could be isolated without affecting other parts.