A comprehensive command-line interface (CLI) library management system built in Java. This system provides separate interfaces for librarians, professors, and students with role-based access control and complete book management functionality.
- Librarian System: Full administrative access to manage books
- Professor System: Book borrowing with higher limits and profile management
- Student System: Book borrowing with standard limits and profile management
- Add new books with comprehensive details (title, author, ISBN, genre, publication year, quantity, language, pages)
- Delete books from the library database
- Update existing book information
- Display all books in the library
- Advanced search functionality (by title, genre, ISBN, author)
- Book borrowing with quantity tracking
- Book return functionality
- Role-based borrowing limits (different limits for students and professors)
- Real-time borrowing limit tracking
- Search books by multiple criteria
- User-friendly search interface
- Detailed book information display
- Account information display
- Profile update functionality
- Borrowing history tracking
The system is built with object-oriented principles and includes:
- LibraryManagementSystem: Main controller class
- LibraryDatabase: Database management for books
- Librarian: Administrative functions
- Student: Student-specific operations with borrowing limits
- Professor: Professor-specific operations with extended privileges
- Book: Book entity with comprehensive attributes
- Search: Advanced search functionality
- BookLender: Interface for borrowing operations
- Java Development Kit (JDK) 8 or higher
- Clone the repository:
git clone https://github.com/username/library-management-system.git
cd library-management-system- Compile the Java files:
javac -d bin src/system/*.java- Run the application:
java -cp bin system.LibraryManagementSystemWhen you run the application, you'll see the main menu:
------------------------------------
LIBRARY SYSTEM
------------------------------------
1. Librarian Subsystem
2. Professor Subsystem
3. Student Subsystem
4. Exit
Enter your choice:
Access the librarian system to:
-
Add Book: Enter comprehensive book details including:
- Title (must be unique)
- Author (alphabetic characters only)
- ISBN (unique numeric identifier)
- Genre (alphabetic characters only)
- Publication Year
- Book Quantity
- Language
- Number of Pages
-
Delete Book: Remove books using ISBN
-
Update Book: Modify existing book information
-
Display All Books: View complete library inventory
Both user types can:
- Show Account Info: Display user profile and borrowing information
- Borrow Book:
- View available books
- Select book by ISBN
- System checks borrowing limits and book availability
- Return Book:
- View borrowed books
- Return book by ISBN
- Updates library inventory automatically
- Profile Update: Modify user information
- Search Book: Use advanced search by title, genre, ISBN, or author
Enter book details:
Title: The Great Gatsby
Author: F Scott Fitzgerald
ISBN: 9780743273565
Genre: Fiction
Publication Year: 1925
Book Quantity: 5
Language: English
Pages: 180
Available Books:
[Book list displays]
Enter Book ISBN: 9780743273565
Book Borrowed!
Remaining borrowing limit as a student: 4
The system includes comprehensive input validation:
- Duplicate Prevention: No duplicate titles or ISBNs allowed
- Format Validation: Author, genre, and language must contain only alphabetic characters
- Numeric Validation: ISBN, publication year, quantity, and pages must be positive integers
- Empty Field Prevention: All required fields must be filled
- Students: Limited number of books (configurable via librarian settings)
- Professors: Higher borrowing limits than students
- Real-time Tracking: System displays remaining borrowing capacity
The system provides multiple search options:
- Search by Title: Find books with matching titles
- Search by Genre: Browse books by category
- Search by ISBN: Direct book lookup
- Search by Author: Find all books by a specific author
- Book not found scenarios
- Insufficient quantity warnings
- Borrowing limit enforcement
library-management-system/
├── src/
│ └── system/
│ ├── LibraryManagementSystem.java # Main application class
│ ├── LibraryDatabase.java # Database management
│ ├── Librarian.java # Librarian operations
│ ├── Student.java # Student operations
│ ├── Professor.java # Professor operations
│ ├── Book.java # Book entity
│ ├── User.java # Manage Users operations and constraints
│ ├── Search.java # Search functionality
│ └── BookLender.java # Borrowing interface
├── bin/ # Compiled classes
└── README.md
- Due date tracking and overdue notifications
- Book reservation system
- Fine calculation for overdue books
- Export/import functionality for book data
- GUI version of the application
- User authentication system
- Book recommendation system
- Data is not persisted between application runs (in-memory storage)
- No user authentication - role selection is based on menu choice