Bird
0
0
LLDsystem_design~12 mins

Class design (Book, Member, Librarian, Loan) in LLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - Class design (Book, Member, Librarian, Loan)

This system models a library management scenario. It manages books, members who borrow books, librarians who manage the library, and loans that track book borrowing. The key requirements are to track book availability, member borrowing history, and librarian actions.

Architecture Diagram
  +---------+       +-----------+       +----------+       +----------+
  |  Member |<----->|   Loan    |<----->|   Book   |       | Librarian|
  +---------+       +-----------+       +----------+       +----------+
       ^                 ^                  ^                 ^
       |                 |                  |                 |
       +-----------------+------------------+-----------------+
Components
Book
class
Represents a book with details like title, author, and availability.
Member
class
Represents a library member who can borrow books.
Librarian
class
Represents a librarian who manages books and loans.
Loan
class
Tracks the borrowing of a book by a member including loan dates.
Request Flow - 5 Hops
MemberLoan
LoanBook
BookLoan
LoanMember
LibrarianBook
Failure Scenario
Component Fails:Loan
Impact:New borrow requests cannot be processed, loan records cannot be created or updated.
Mitigation:System queues borrow requests and alerts librarian to fix loan system; members can still view book and member info.
Architecture Quiz - 3 Questions
Test your understanding
Which class is responsible for tracking when a book is borrowed?
ALoan
BBook
CMember
DLibrarian
Design Principle
This design separates concerns by using distinct classes for books, members, librarians, and loans. It models real-world roles and actions clearly, enabling easy tracking of book borrowing and management.