A class defines the objects in an object-oriented design and organizes their data, behavior, and relationships. That organization can clarify a library system—or multiply its complexity. section 1.1.1
A library system becomes a class diagram
Theo models Library, Book, BookItem, BookLending, Member, Librarian, User, Catalog, and Author as classes. User becomes a base class for Member and Librarian, while relationships between the classes carry much of the design's complexity. section 1.1.1
When every endpoint gets a class
For a JSON /search endpoint, Theo creates SearchController, SearchQuery, and SearchResult. Repeating the same arrangement for every endpoint duplicates serialization and deserialization code, turning a tidy abstraction into a maintenance problem. section 1.2.3
A class can serve several roles:
- Represent a domain entity such as a book, member, or catalog. section 1.1.1
- Act as a base class, as User does for Member and Librarian. section 1.1.1
- Aggregate stateless functions operating on related domain entities, reducing the complexity of classes. section 11.8
Use the class diagram to inspect the proposed entities and their relationships before implementation. section 1.1.1




















