Archicise
Exercise

Design a Library Management System

Design the class hierarchy and object model for a library management system that handles books, members, loans, and reservations.

Functional Requirements

  • Manage a catalog of books with multiple copies
  • Register and manage library members
  • Handle book loans and returns
  • Support reservations for unavailable books
  • Send overdue notifications
  • Apply fine calculations for late returns

Design Challenges

  • Model the relationship between Book (concept) and BookCopy (physical)
  • Apply value objects for ISBN, due dates, and fines
  • Handle the state machine for a loan lifecycle
  • Define clear aggregate boundaries

Questions to Consider

  • What are the core domain aggregates?
  • How do you enforce invariants like loan limits per member?
  • Where does business logic live — in entities, services, or both?
Your Solution

Core Domain Model

Identify and design the core entities and value objects. Define Book, BookCopy, Member, Loan, and Reservation as classes. Clarify which are entities (have identity) vs value objects (defined by their values). Specify key attributes and types.