Pinned
SOLID Principles Simplified #3: Liskov Substitution Principle (LSP)
If B is a subtype of A, objects of B should be usable wherever objects of A are expected.
Aug 22, 20266 min read8
Search for a command to run...
If B is a subtype of A, objects of B should be usable wherever objects of A are expected.
Not "what does SRP stand for" - the questions that came after that one.
Why did my order end up with a modern chair and a Victorian sofa?
Why does my checkout code have five if/else blocks just to pick a payment gateway?
Wait, there are HOW many design patterns?
Why does changing my email service break my entire notification system?
Why do I have to implement a method I'm never going to use?
Software entities should be open for extension but closed for modification.
A class should have only one reason to change.