Letβs Build a Library Management System With OOPS
26 May 2025 at 14:40
Problem Statement
Overview
Design a command-line-based Library Management System that simulates the basic operations of a library for both users and administrators. It should manage books, user accounts, borrowing/returning of books, and enforce library rules like book limits per member.
Goals
- Allow members to search, borrow, and return books.
- Allow admins to manage the libraryβs inventory.
- Track book availability.
- Prevent double borrowing of a book.
Actors
- Admin
- Member
Suggested Classes
Book
: ID, title, author, genre, is_availableUser
: username, role, user_idMember(User)
: borrowed_books (max 3 at a time)Admin(User)
: can add/remove booksLibrary
: manages collections of books and users
Features
- Admin:
- Add a book with metadata
- Remove a book by ID or title
- List all books
- Member:
- Register or login
- View available books
- Borrow a book (limit 3)
- Return a book
- Library:
- Handles storage, availability, and user-book mappings
OOP Concepts
- Inheritance:
Admin
andMember
inherit fromUser
- Encapsulation: Bookβs availability status and memberβs borrow list
- Polymorphism: Different
view_dashboard()
method for Admin vs Member
Optional Extensions
- Track borrowing history (borrow date, return date)
- Due dates and overdue penalties
- Persistent data storage (JSON or SQLite)