educative.io

Why bookLending and bookReservation are clasees?

Sine lending and reservation are the actions on the book item. It should have been methods on book items.


Course: Grokking the Low Level Design Interview Using OOD Principles - Learn Interactively
Lesson: https://www.educative.io/courses/grokking-the-low-level-design-interview-using-ood-principles/class-diagram-for-the-library-management-system

Hello @rishabh_pawan,

In the Library Management System implementation, having separate classes for BookLending and BookReservation rather than methods in BookItem follows a design choice for modular, maintainable code. This separation adheres to principles like Single Responsibility and allows scalability for future extensions without modifying the core BookItem class.

Happy Learning :slight_smile: