This project is a desktop-based Inventory Management System developed using Java Swing.
The system is designed to manage:
- Products
- Stock Levels
- Suppliers
- Orders
- Reports
The application follows a modular and scalable architecture and applies several object-oriented design patterns to ensure maintainability, flexibility, and code reuse.
The system is divided into the following main layers:
Provides graphical user interfaces using Java Swing components.
Main Components:
MainFrame– Main application window with navigation tabs.ProductPanel– Add and list products.OrderPanel– Place and view orders.SupplierPanel– Manage supplier data.ReportPanel– Generate and display reports.
Represents real-world entities as Java classes:
ProductOrderSupplierLocalSupplierInternationalSupplier
Singleton classes responsible for managing system data:
StockManagerOrderManagerSupplierManager
Handles object creation logic:
ProductFactorySupplierFactory
Responsible for generating dynamic and formatted reports.
- Uses Decorator Pattern
- Uses Strategy Pattern for report generation
Handles stock alerts and notifications:
- Notifies when stock levels fall below a defined threshold.
Purpose:
Ensures that only one instance of a class exists and provides global access.
Used In:
StockManagerOrderManagerSupplierManagerReportGenerator
Purpose:
Creates objects without exposing the creation logic.
Used In:
ProductFactory- Electronics
- Furniture
- Groceries
SupplierFactory- Local
- International
Purpose:
Allows incompatible interfaces to work together.
Used In:
ProductAdapter– Adapts product data to report format.OrderAdapter– Adapts order data to report format.
Common Interface:
ReportableAdapter
Purpose:
Adds responsibilities to objects dynamically.
Used In:
HeaderDecorator– Adds title and date to reports.FooterDecorator– Adds footer/end tag to reports.
Purpose:
Defines a one-to-many dependency between objects.
Used In:
StockManagernotifies observers when stock is low.LowStockNotifierimplementsStockObserverto receive alerts.
- MainFrame: Hosts navigation tabs for all modules.
- ProductPanel: Adds products and displays them in a table.
- OrderPanel: Creates orders and validates inventory levels.
- SupplierPanel: Manages supplier information.
- ReportPanel: Generates inventory and order reports.
- StockManager: Manages inventory and observers.
- OrderManager: Stores all orders.
- SupplierManager: Manages suppliers.
- ReportGenerator: Generates formatted reports using adapters.
- ProductFactory: Dynamically creates product objects.
- SupplierFactory: Creates supplier instances based on type.
Strategies:
FullInventoryReportStrategyLowStockReportStrategy
Decorators:
HeaderDecoratorFooterDecorator
Adapters:
ProductAdapterOrderAdapter
StockObserverinterface withonStockLow(Product)method.LowStockNotifierprints warnings when stock drops below threshold.
- Java
- Java Swing
- Object-Oriented Programming (OOP)
- Design Patterns
This Inventory Management System demonstrates the practical application of multiple design patterns in a real-world Java desktop application, providing a clean, extensible, and maintainable codebase.