SOLID & OOP Principles (50 Qs)•Part 1: Core SOLID Principles & Fundamentals (1 - 10)
Why does Composition over Inheritance prevent the Fragile Base Class problem?
junior LevelMost Askedsolid-principlesCore SOLID Principles
In Simple Words: Inheritance is the tightest coupling in OOP because subclasses depend on the internal implementation details of the superclass. A change in the parent class can silently break subclass invariants (Fragile Base Class). Composition delegates behavior via interfaces, keeping boundaries clean and independently testable.