A clean, fully object-oriented Java console application to manage a library's books, authors, customers, and loans.
πΊπΈ English Β· π§π· PortuguΓͺs
Digital Library System is a Java console application built from scratch to simulate a real-world library management experience. Designed with clean OOP principles, the project covers class design, object relationships, collections, and user interaction β all through a text-based menu interface.
This project was developed as part of a Java learning journey, focused on applying and expanding core concepts in a practical, real-world scenario.
| Feature | Description |
|---|---|
| π List Available Books | View all books currently available for borrowing |
| π Search Books | Find books by title or author |
| π Filter by Genre | Browse books from a specific genre |
| π Filter Recent Books | See books added in the last 7 days |
| π€ Borrow a Book | Register a loan by linking a book to a customer |
| π€ Register Customer | Add a new customer with name and email |
| π List Customers | View all registered customers |
| π Loan History | View all loans associated with a specific customer |
| πͺ Exit | Gracefully close the application |
π¦ digital-library
β£ π Main.java β Entry point & interactive console menu
β£ π Library.java β Container holding books, authors, and loans
β£ π LibraryService.java β Business logic (search, filter, borrow, customers)
β£ π Book.java β Book model (id, title, author, genre, dates, availability)
β£ π Author.java β Author model (id, name, birthDate)
β£ π Customer.java β Customer model (id, name, email)
β π LibraryLoan.java β Loan model (book β customer, borrow/return dates)
βββββββββββββββ ββββββββββββββββ
β Library ββββββββββ LibraryLoan β
βββββββββββββββ loans ββββββββββββββββ
β books β β id β
β authors β β book βββββββββββββββΊ Book
β loans β β customer βββββββββββΊ Customer
βββββββββββββββ β borrowDate β
β returnDate β
ββββββββββββββββ
ββββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β LibraryService β β Book β β Author β
ββββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β + searchBooks β β id β β id β
β + filterGenre β β title β β name β
β + borrowBook β β author β β birthDate β
β + getHistory β β genre β ββββββββββββββββ
β + register... β β available β
ββββββββββββββββββ β dates β ββββββββββββββββ
ββββββββββββββββ β Customer β
ββββββββββββββββ
β id β
β name β
β email β
ββββββββββββββββ
- Java 17 or higher installed
- A terminal / command prompt
# 1. Clone the repository
git clone https://github.com/michellesanseverino/library_practice.git
cd library_practice
# 2. Compile all Java files
javac *.java
# 3. Run the application
java Mainββββββββββββββββββββββββββββββββββββββββ
β Welcome to the Digital Library! β
ββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββ
MAIN MENU
ββββββββββββββββββββββββββββββ
1. List available books
2. Search books (title/author)
3. Filter books (genre/recent)
4. Borrow a book
5. List all customers
6. Register new customer
7. View customer loan history
0. Exit
ββββββββββββββββββββββββββββββ
>
- Object-Oriented Programming β Encapsulation, abstraction, and class responsibility separation
- Collections β
List<T>andArrayList<T>for storing books, authors, customers, and loans - Java Streams β
.stream().filter().collect()for search and filtering logic - LocalDate API β Date handling for registration, loans, and filtering recent books
- Service Layer Pattern β
LibraryServiceseparates business rules from the UI layer - Console I/O β
Scannerfor user interaction with proper input validation
- Persist data with file I/O or a database (SQLite / H2)
- Add a return book feature with
returnDate - Implement fine calculation for overdue loans
- Add a book registration menu option
- Unit tests with JUnit 5
Sistema de Biblioteca Digital Γ© uma aplicaΓ§Γ£o Java de console criada do zero para simular o gerenciamento real de uma biblioteca. Desenvolvida com princΓpios limpos de POO, o projeto cobre design de classes, relacionamentos entre objetos, coleΓ§Γ΅es e interaΓ§Γ£o com o usuΓ‘rio β tudo por meio de um menu de texto interativo.
Este projeto foi desenvolvido como parte de uma jornada de aprendizado em Java, com foco em aplicar e expandir os conceitos principais em um cenΓ‘rio prΓ‘tico e real.
| Funcionalidade | DescriΓ§Γ£o |
|---|---|
| π Listar Livros | Veja todos os livros disponΓveis para emprΓ©stimo |
| π Buscar Livros | Encontre livros por tΓtulo ou autor |
| π Filtrar por GΓͺnero | Navegue por livros de um gΓͺnero especΓfico |
| π Livros Recentes | Veja livros adicionados nos ΓΊltimos 7 dias |
| π€ Realizar EmprΓ©stimo | Registre um emprΓ©stimo vinculando livro a cliente |
| π€ Cadastrar Cliente | Adicione um novo cliente com nome e e-mail |
| π Listar Clientes | Visualize todos os clientes cadastrados |
| π HistΓ³rico de EmprΓ©stimos | Veja todos os emprΓ©stimos de um cliente especΓfico |
| πͺ Sair | Encerra a aplicaΓ§Γ£o com uma mensagem de despedida |
π¦ digital-library
β£ π Main.java β Ponto de entrada e menu interativo no console
β£ π Library.java β ContΓͺiner com livros, autores e emprΓ©stimos
β£ π LibraryService.java β Regras de negΓ³cio (busca, filtro, emprΓ©stimo, clientes)
β£ π Book.java β Modelo de livro (id, tΓtulo, autor, gΓͺnero, datas, disponibilidade)
β£ π Author.java β Modelo de autor (id, nome, dataNascimento)
β£ π Customer.java β Modelo de cliente (id, nome, email)
β π LibraryLoan.java β Modelo de emprΓ©stimo (livro β cliente, datas)
- Java 17 ou superior instalado
- Um terminal / prompt de comando
# 1. Clone o repositΓ³rio
git clone https://github.com/michellesanseverino/library_practice.git
cd library_practice
# 2. Compile todos os arquivos Java
javac *.java
# 3. Execute a aplicaΓ§Γ£o
java Main- ProgramaΓ§Γ£o Orientada a Objetos β Encapsulamento, abstraΓ§Γ£o e separaΓ§Γ£o de responsabilidades entre classes
- ColeΓ§Γ΅es β
List<T>eArrayList<T>para armazenar livros, autores, clientes e emprΓ©stimos - Java Streams β
.stream().filter().collect()para lΓ³gica de busca e filtragem - API LocalDate β ManipulaΓ§Γ£o de datas para cadastro, emprΓ©stimos e filtro de livros recentes
- PadrΓ£o Service Layer β
LibraryServicesepara as regras de negΓ³cio da camada de interface - Console I/O β
Scannerpara interaΓ§Γ£o com o usuΓ‘rio com validaΓ§Γ£o de entrada
- Persistir dados com arquivo ou banco de dados (SQLite / H2)
- Adicionar funcionalidade de devoluΓ§Γ£o de livro com
returnDate - Implementar cΓ‘lculo de multa para emprΓ©stimos em atraso
- Adicionar opΓ§Γ£o de cadastro de livro pelo menu
- Testes unitΓ‘rios com JUnit 5
Made with β and Java