This project is a Java-based Library System that demonstrates the implementation of multiple Design Patterns.
-
Singleton
- Ensures that only one instance of
LibraryServiceexists in the system.
- Ensures that only one instance of
-
Factory
BookFactoryis used to create different types of books such as:- EBook
- PhysicalBook
- HistoricalBook
-
Decorator
PremiumBookDecoratoradds an extra 10 days for borrowing without modifying the originalBookclass.
-
Proxy
PremiumEBookProxyrestricts access to EBooks so that only premium users can borrow them.
-
Chain of Responsibility
- Borrowing requests go through:
- Librarian
- Manager
- Borrowing requests go through:
-
Facade
LibraryFacadesimplifies the borrowing and returning operations by hiding the internal workflow.
-
Adapter
BookAdapterconverts external book data into the system'sBookentity.
-
Observer
NotifiableBooknotifies registered users when a book becomes available.
- Add books to the library
- Borrow and return books
- Support premium books
- Restrict premium eBook access
- Handle borrowing approval flow
- Adapt external book data
- Notify users when books are available
- Java
- Object-Oriented Programming (OOP)
- Design Patterns
Mohamed Tarek