❌

Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

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_available
  • User: username, role, user_id
  • Member(User): borrowed_books (max 3 at a time)
  • Admin(User): can add/remove books
  • Library: 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 and Member inherit from User
  • 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)

❌
❌