A robust, Object-Oriented Java application designed to manage library operations efficiently. This system enables administrators to track book inventory, manage library members, and handle the book borrowing/returning workflow with built-in validation rules.
- Object-Oriented Design: Implements clean separation of concerns using
Book,Member, andLib(Library) classes. - State Management: Tracks the availability status of books in real-time, preventing unauthorized borrowing.
- Data Validation: * Enforces strict length constraints for
Book ID(5 characters) andMember ID(6 characters).- Prevents invalid operations such as borrowing unavailable books or exceeding the maximum limit of 3 borrowed books per member.
- Robust Error Handling: Uses
IllegalArgumentExceptionandIllegalStateExceptionto manage domain-specific errors gracefully.
- Language: Java (JDK 8+)
- Architecture: Object-Oriented Design (OOD)
- Core Logic: *
Book: Manages book details and availability state.Member: Handles member registration and manages a list of borrowed items.Lib: Acts as the central controller for library operations.
This application demonstrates core Java capabilities. Upon execution, the system:
- Initializes the library with a collection of books.
- Registers members.
- Processes borrowing requests with validation checks.
- Returns books and updates library inventory.
- Prints the final state of the library, including all books and member activities.
- Ensure you have Java installed.
- Compile the classes:
javac *.java - Run the main application:
java Main