A simple Java console application simulating a basic library system, built to practice object-oriented programming concepts from:
"The Object-Oriented Thought Process" β Matt Weisfeld
- Encapsulation
- Abstraction & Inheritance
- Polymorphism
- Composition over Inheritance
- Interfaces
- Dependency Injection
- SOLID Principles
Principle | Applied | Explanation |
---|---|---|
S β Single Responsibility | β | Each class has one job: loaning, user handling, notification, etc. |
O β Open/Closed | β | New book types (e.g., Article , Novel ) can be added without changing existing logic. |
L β Liskov Substitution | β | Book references accept any subclass without breaking behavior. |
I β Interface Segregation | Not critical yet; single interface is enough for now. | |
D β Dependency Inversion | β | LoanManager depends on NotificationService interface, not a concrete class. |
Book
,User
,LoanRecord
β domain entitiesLoanManager
,BookManager
,UserManager
β business logicNotificationService
,EmailNotificationService
β interface & implementationLibrary
β orchestrator classLoanManagerTest
β unit tests using JUnit 5 & Mockito
- Java 21
- Maven
- JUnit 5
- Mockito
mvn clean test