Liskov Substitution Principle (LSP) - Subtype

Liskov Substitution Principle (LSP) - Subtype

Liskov Substitution Principle (LSP)

  • the principle defines that objects of a superclass shall be replaceable with objects of its subclasses without breaking the application

Subtype Requirement

Let 𝜑(𝑥) be a property provable about objects 𝑥 of type 𝑋. Then 𝜑(𝑦) should be true for objects 𝑦 of type 𝑌 where 𝑌 is a subtype of 𝑋