Skip to content
Low Level Design Mastery Logo
LowLevelDesign Mastery

All Together

See all relationships working together in a real-world system.

Let’s build a complete Library Management System that demonstrates all four class relationships working together.

We’ll design a library system with:

  • Library (main system)
  • Book (items in library)
  • Member (people who borrow books)
  • Librarian (staff managing library)
  • Loan (borrowing record)
  • Fine (penalty for late returns)
Diagram
  • Why: Both share common attributes (name, email) and have roles
  • Type: “Is-a” relationship
  • Why: Books are part of library, loans belong to members, fines belong to loans
  • Type: Strong ownership, cannot exist independently
  • Why: Members and librarians can exist independently (can transfer/leave)
  • Type: Weak ownership, independent lifecycle
  • Why: Loan references these classes but doesn’t own them
  • Type: “Knows-a” relationship
  • Why: Used temporarily as method parameters
  • Type: Temporary use, no storage

💡 Time to Practice!

Now that you understand the concepts, put them into practice with our interactive playground. Build UML diagrams, write code, and get AI-powered feedback.

Browse All Problems