Search results
Results from the WOW.Com Content Network
The Liskov substitution principle (LSP) is a particular definition of a subtyping relation, called strong behavioral subtyping, that was initially introduced by Barbara Liskov in a 1987 conference keynote address titled Data abstraction and hierarchy.
In an influential keynote address [4] on data abstraction and class hierarchies at the OOPSLA 1987 programming language research conference, Barbara Liskov said the following: "What is wanted here is something like the following substitution property: If for each object of type S there is an object of type T such that for all programs P defined in terms of T, the behavior of P is unchanged ...
The Liskov substitution principle (LSP) states that "[f]unctions that use pointers or references to base classes must be able to use objects of derived classes without knowing it." [ 5 ] See also design by contract .
Her notable work includes the introduction of abstract data types and the accompanying principle of data abstraction, along with the Liskov substitution principle, which applies these ideas to object-oriented programming, subtyping, and inheritance. Her work was recognized with the 2008 Turing Award, the highest distinction in computer science.
Liskov substitution principle in computer science is a particular definition of a subtyping relation, called (strong) behavioral subtyping. Llinás's law: "A neuron of a given kind cannot be functionally replaced by one of another type even if their synaptic connectivity and the type of neurotransmitter outputs are identical."
Liskov substitution principle explains a property, "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 behavior of P is unchanged when o1 is substituted for o2 then S is a subtype of T,". [5] Following example shows a violation of LSP. Here is perhaps an example of violation ...
By definition, this problem is a violation of the Liskov substitution principle, one of the SOLID principles. The problem concerns which subtyping or inheritance relationship should exist between classes which represent circles and ellipses (or, similarly, squares and rectangles ).
In proposing this use of inheritance, the Eiffel designers reject the Liskov substitution principle, which states that objects of subclasses should always be less restricted than objects of their superclass. One other instance of a mainstream language allowing covariance in method parameters is PHP in regards to class constructors.