NOTE

Liskov Substitution Principle

Ensuring subtypes preserve the behavioral contract expected from the base abstraction.

Software Architecture & EngineeringCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

The Liskov Substitution Principle requires that a subtype can be used wherever its base type is expected without violating the base contract.

A subtype should not strengthen preconditions, weaken promised postconditions, or introduce surprising invariants/exceptions that break callers. If substitution is not valid, composition or separate interfaces usually express the model better.

Loading helpful count