Liskov substitution principle


programming, theory
(LSP) The principle that object-oriented functions that use pointers or references to a base class must be able to use objects of a derived class without knowing it.
Barbara Liskov first wrote it as follows: If for each object o1 of type S there is an object o2 of type T such that for all programs P defined in terms of T, the behaviour of P is unchanged when o1 is substituted for o2 then S is a subtype of T.
A function that violates the LSP uses a reference to a base class and must know about all the derivatives of that base class. Such a function violates the open/closed principle because it must be modified whenever a new derivative of the base class is created.
[Liskov, B. Data Abstraction and Hierarchy, SIGPLAN Notices. 23(5), May 1988].
(2001-09-14)

Read Also:

  • Lisle

    [lahyl] /laɪl/ noun 1. knit goods, as gloves or hose, made of . 2. . adjective 3. made of . [leel for 1–3; lahyl for 4] /lil for 1–3; laɪl for 4/ noun 1. . 2. . 3. former name of . 4. a town in NE Illinois. /laɪl/ noun 1. n. 1851, from French […]

  • Lisle-thread

    noun 1. a fine, high-twisted and hard-twisted cotton thread, at least two-ply, used for hosiery, gloves, etc.

  • Lisp

    [lisp] /lɪsp/ noun 1. a speech defect consisting in pronouncing s and z like or nearly like the th- sounds of thin and this, respectively. 2. Phonetics. any unconventional articulation of the sibilants, as the pronunciation of s and z with the tongue between the teeth (lingual protrusion lisp) close to or touching the upper […]

  • Lisp 1

    The original Lisp. Invented by John McCarthy et al at MIT in the late 50’s. Followed by LISP 1.5.

  • Lisp 1.5

    The second version of Lisp, successor to LISP 1. Developed at MIT in 1959. Followed by LISP 1.75, LISP 1.9, Lisp 2 and many other versions.


Disclaimer: Liskov substitution principle definition / meaning should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional. All content on this website is for informational purposes only.