A simple principle can teach you a lot about inheritance in programming: Understanding SOLID’s Liskov Substitution Principle

Lovepreet Singh
System Design
Published in
6 min readFeb 12, 2023

--

This article is part of a series based on the book Clean Architecture by Robert C. Martin. Only the topic heading is taken from the book and is researched in the software community to find what is valuable and acceptable. If you would like to learn with me, please subscribe for upcoming articles.

This is the third principle of SOLID’s five principles that I am explaining in this clean architecture publication with the help of simple examples.

  1. Single Responsibility Principle
  2. Open Closed Principle
  3. Liskov Substitution Principle
  4. Interface Segregation Principle
  5. The Dependency Inversion Principle

Liskov Substitution Principle

When I started researching about Liskov substitution principle, it all seemed simple from a high level. However, as I tried to understand more deeply, I came across many programming concepts that I didn’t know before even though I have been a software engineer for a long time. I was surprised at how much I didn’t know about things that I use almost every time I code. Let’s understand some interesting programming concepts as we learn SOLID’s third principle.

--

--

Lovepreet Singh
System Design

Like To Break Complex Topics | Micro Frontends Enthusiastic | Angular Expert | Principal Engineer | https://topmate.io/lovepreets