Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Library Management System — Low Level Design

Problem Statement

Build a console-driven library system that supports:

  1. Adding a book (title, author, quantity)
  2. Displaying available books
  3. Borrowing a book
  4. Returning a book
  5. Quitting cleanly

Design

  • ILibraryService / LibraryService — owns the Library entity and exposes AddBook, DisplayBooks, BorrowBook, ReturnBook.
  • Book — title, author, quantity, and borrowed count; Available is derived (quantity - borrowed), not stored.
  • Command pattern — each menu action (AddBookCommandRunner, BorrowBookCommandRunner, DisplayBookCommandRunner, ReturnBookCommandRunner, QuitCommandRunner) is its own class implementing a common CommandRunner abstraction, so Program.cs never branches on user choice directly.
  • CommandRunnerFactory — maps the user's menu input to the right command runner, keeping Program.cs's loop a thin dispatch layer.
  • IConsoleWrapper — abstracts console I/O behind an interface so command runners and the service are unit-testable without a real console.
  • InvalidCommandException — surfaces bad menu input as a typed error instead of crashing the loop.
  • Unit tests (Library_Management_Test) — one test class per command runner, plus the service itself.

Tech

C# / .NET 6

How to Run

  • Rebuild the solution
  • Navigate to /Library_Management/bin/debug/net6.0
  • Run Library_Management.exe
  • Menu: Add Book → Display Available Books → Borrow Book → Return Book → Quit

About

Library management system low level design (C#)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages