Alexandria University – Faculty of Engineering
Fall 2025/2026
This Java application implements a fully object-oriented Inventory Management System for a retail store, supporting two user roles: Admins and Employees. The system uses abstraction, inheritance, and polymorphism to eliminate code duplication and ensure maintainable, scalable code.
All data is persisted in plain-text files, and the architecture follows a clean separation between data entities, database logic, and user roles.
- Add new employees
- Remove existing employees
- Data stored in
Employees.txt
- Add new products to inventory
- Sell products to customers (decrements stock)
- Process returns within 14 days of purchase
- Apply payments to customer purchases
- Data stored in:
Products.txtCustomersProducts.txt
A return is accepted only if:
- Return date ≥ purchase date
- Product exists in inventory
- Purchase record exists
- Return occurs within 14 days of purchase
On successful return, product quantity is increased and the purchase record is removed.
All data entities implement the Record interface, which defines:
String getSearchKey()→ unique identifier (e.g., employee ID, product ID, or composite key)String lineRepresentation()→ format for file storage
- Contains a collection of
Recordobjects - Provides shared file I/O and CRUD logic (read, save, search, insert, delete)
- Not generic—uses polymorphism via the
Recordinterface
Each extends Database and handles type-specific logic:
EmployeeUserDatabase→ managesEmployeeUserrecordsProductDatabase→ managesProductrecordsCustomerProductDatabase→ managesCustomerProductrecords
EmployeeUser→ employee info (ID, name, email, etc.)Product→ product details (ID, name, quantity, price, etc.)CustomerProduct→ purchase record (customer SSN, product ID, date, payment status)