University Library System
Java MVC console app with inheritance hierarchies, polymorphic loan rules, and custom CSV persistence.
Distinction Grade (80%)
Achieved a First-Class mark for software architecture quality, clean code practices, and comprehensive documentation.

Challenge
Modelling complex entity relationships and enforcing role-specific business rules with file-based persistence and no database.
Approach
Developed a Java MVC console app using inheritance hierarchies, polymorphic loan rules, and a custom CSV persistence engine.
What it does
MVC + OOP Architecture
Model-View-Controller with abstract base classes and composition patterns.
CSV Persistence Engine
Custom DataLoader serializes complex object graphs, decoupling logic from storage.
Role-Based Loan Rules
Polymorphic constraints enforce per-role limits (10 Adult, 3 Child) and suspension states.
JUnit + Functional Tests
White-box unit tests for core logic combined with end-to-end workflow testing.
Class Hierarchy
| Base Class | Subclasses | Key Responsibilities |
|---|---|---|
| Product (Abstract) | Book, CD, DVD, Audiobook | Stores metadata (ISBN, Title), manages loan status |
| User (Abstract) | Student, ChildUser, AdultUser | Manages personal info, active loans, and permissions |
| Loan | N/A | Links Users to Products, tracks due dates and fines |
Testing Verification
| Test Type | Scope | Key Scenarios Verified |
|---|---|---|
| Functional | End-to-End User Flows | Login, Product Visibility (DVDs hidden for Students), Error Handling |
| Unit (JUnit) | Core Business Logic | Borrowing Limits (10/5/3), Guardian Assignment, ID Uniqueness |
| Regression | Bug Fix Verification | Loan state consistency between Controller and User classes |