- read

Practical SOLID in TypeScript: Liskov Substitution Principle

Marko Milojevic 36

Practical SOLID in TypeScript: Liskov Substitution Principle

We continue a journey through the SOLID principles by presenting the one with the most complicated definition — The Liskov Substitution Principle.

Marko Milojevic
JavaScript in Plain English
8 min read1 day ago

--

Photo by Daniel Cheung on Unsplash

I’m not really a fan of reading. Often, when I do read, I find myself losing track of the text’s topic for the past few minutes. I often go through an entire chapter without grasping what it was all about in the end.

It can be frustrating when I’m trying to focus on the content, but I keep realizing I need to backtrack. That’s when I turn to various types of media to learn about a topic.

The first time I encountered this reading issue was with the SOLID principle, specifically the Liskov Substitution Principle. Its definition was (and still is) too complicated for my taste, especially in its formal format.

As you can guess, LSP represents the letter “L” in the word SOLID. It’s not difficult to understand, although a less mathematical definition would be appreciated.

Disclaimer: Effective September 1st, 2023, the referral system on Medium
is no longer operational. If you appreciate this DDD series and would
like to endorse the efforts of both myself and fellow authors on Medium,
kindly demonstrate your support through claps, follows, or comments on
our blogs. Your consideration is greatly appreciated. Thank you in advance!

Other articles from the DDD series:

  1. Practical DDD in TypeScript: Why Is It Important?
  2. Practical DDD in TypeScript: Value Object
  3. Practical DDD in TypeScript: Entity
  4. Practical DDD in TypeScript: Domain Service
  5. Practical DDD in TypeScript: Domain Event
  6. Practical DDD in TypeScript: Module
  7. Practical DDD in TypeScript: Aggregate
  8. Practical DDD in TypeScript: Factory