educative.io

Why BookItem extends Book?

I think the relationship should be association instead of inheritance
In the inheritance design
- Book is not BookItem, which violate OOP inheritance principle and SOLID Liskovo principle
- We can modify the Book data through BookItem objects, which I think a bad design


Course: Grokking the Low Level Design Interview Using OOD Principles - Learn Interactively
Lesson: Class Diagram for the Library Management System


Course: Grokking the Low Level Design Interview Using OOD Principles - Learn Interactively
Lesson: Class Diagram for the Library Management System

Hi @Mahmoud_Shousha

I hope everything is going well with you. Your observation is valid, and I appreciate your attention to good design principles. We have updated the course. Thanks for pointing it out.
Happy Learning :slight_smile:

1 Like