A modular, extensible Library Management System implemented in Java, designed with object-oriented best practices and multiple design patterns.
The system supports library operations such as user management, work cataloging, borrowing/returning, notifications, rule enforcement, and advanced searching, all through a clean separation between core logic and user interface layers.
- 📖 Manage different types of works (Books, DVDs, etc.)
- 👤 User registration, behavior tracking, fines, and notifications
- 🔄 Borrowing and returning workflows with rule validation
- 🔍 Advanced search using the Visitor pattern
- 🔔 Event-driven notifications for availability and requests
- 🧱 Clean separation between Application, Core Domain, and UI Library
- 🧪 Robust exception handling across all layers
- 🧩 Highly extensible architecture
The project follows a layered architecture:
-
Core:
bci-core/
Contém as classes de domínio principais da aplicação. -
Interaction:
bci-app/
Contém as classes responsáveis pela interação com o utilizador. -
UML diagrams:
uml/
Contém os diagramas UML da primeira entrega.
- Used for advanced search functionality
- Decouples search logic from domain entities
(SearchVisitor,SearchFilterVisitor)
- Used in the notification subsystem
- Enables event-driven updates
(NotificationService,NotificationListener)
- Used for user behavior management
- Dynamic behavior switching
(NormalBehaviour,AbidingBehaviour,WrongfulBehaviour)
- Used extensively in the application layer
- Each user action is encapsulated as a command
(DoRegisterUser,DoRequestWork, etc.)
- UI is fully decoupled from business logic
- Core logic is reusable and UI-agnostic
- Abstract
Workclass - Concrete implementations:
BookDVD
- Associated entities:
CreatorCategory
Userentity with dynamic behavior- Borrowing requests via
Request - Fine management and notifications
Borrowing rules enforced via:
Ruleinterface- Concrete implementations:
NoDuplicateRequestRuleLimitRequestRulePriceLimitRuleNotSuspendedRuleNoReferenceWorkRule
The system uses domain-specific exceptions to ensure robustness and clarity:
UserUnknownExceptionWorkUnknownExceptionRuleNotMetExceptionBorrowingRuleFailedExceptionUnavailableFileException
This approach guarantees:
- Clear error propagation
- Strong domain boundaries
- UI-friendly error handling
- Java 11+
make
Before running the program, you need to configure the CLASSPATH to include the po-uilib.jar library, which is used for the text-based interface.
Em Linux/MacOS:
export CLASSPATH=.:po-uilib/po-uilib.jarEm Windows (PowerShell):
set CLASSPATH=.;po-uilib\po-uilib.jarmake
## Compilação e Execução
The compilation of the entire project (including the po-uilib library) is done automatically through the main Makefile.
```bash
makeSe quiseres definir esta configuração permanentemente, adiciona o comando ao teu ficheiro de inicialização (.bashrc, .zshrc, etc.).