Skip to main content

Liskov Substitution Principle (LSP)

What is this?

  • This principle say:

The subclasses should be replaceable by the base classes.

  • The class extends the behavior, but never reduce the behavior from the father.

Why?

  • The subclasses should be able to implement behaviors from the father class.