Why the Seat Class is made Abstract?

Why cannot we take Seat as a concrete Class and make the implementation based on the different types of Seat, i.e selecting the price etc.
Why are we making it as an abstract class ?


Course: Grokking the Low Level Design Interview Using OOD Principles - Learn Interactively
Lesson: Class Diagram for the Movie Ticket Booking System - Grokking the Low Level Design Interview Using OOD Principles

Hi @Kushal_Agarwal,

Creating an abstract class for Seat with concrete subclasses for different seat types, like Silver, Gold, and Platinum, is a design decision that promotes code reusability, polymorphism, and maintainability. It allows for a consistent interface across seat types, making it easier to manage and extend the system in the future. Additionally, it enforces common behaviors and properties while providing a clear hierarchy that reflects the relationships between different seat types, aiding in code organization and comprehension.

Happy Learning :slight_smile: