Liskov substitution principle |
In .)
The principle was formulated succinctly in [http://reports-archive.adm.cs.cmu.edu/anon/1999/CMU-CS-99-156.ps a subsequent paper] as follows:
: Let q(x) be a property provable about objects x of type T. Then q(y) should be true for objects y of type S where S is a subtype of T.
Thus, Liskov and Wing s notion of subtype is based on the notion of substitutability; that is, if S is a subtype of T, then objects of type T in a program may be replaced with objects of type S without altering any of the desirable properties of that program (e.g., Correctness).
In general, the principle mandates that at all times objects from a class can be swapped with objects from an inheriting class, without the user noticing any other new behaviour. It has effects on the paradigms of design by contract, especially regarding to Program specification: *postconditions for methods in the subclass should be more strict than those in the superclass *preconditions for methods in the subclass should be less strict than those in the superclass *no new exceptions should be introduced in the subclass
=External links=
*Citeseer page for the original paper: http://citeseer.ist.psu.edu/liskov94family.html|
|