Roadmap › Low-Level Design (LLD) — Object Design, UML and Classic Problems in C# › Module: Foundations of Object Design
Lessons in this course (8)
1. From requirements to classes — nouns, verbs and responsibilities
Basic★ Must knowLesson 1 of 8
Technique: write the use cases as sentences, underline nouns (candidate classes) and verbs (methods), then assign each responsibility to the class that owns the data it needs (Information Expert).
Example — "A member borrows a book copy from the library; the system records the due date and charges a fine if it is returned late."
| Nouns → classes | Verbs → methods | Owner |
|---|---|---|
| Member, Book, BookCopy, Library, Loan, Fine | borrow, return, record due date, charge fine | Library.Borrow(member, copy) creates a Loan; Loan.Return(date) computes overdue days; IFinePolicy.Calculate(loan) gives the amount |
Guidelines:
- Each class has one reason to change (SRP).
- Prefer composition ("has-a") over inheritance; inherit only for true "is-a" with shared behaviour.
- Depend on interfaces for things that vary (payment methods, pricing rules, notification channels).
- Use enums for fixed sets of states/types; use State/Strategy when behaviour differs per state/type.
- Make invalid states impossible (private setters, constructor validation, value objects like
Money).