| |
Liskov substitution principle - Wikipedia, the free encyclopedia |
 | | 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 addition, the principle implies that no new exceptions should be thrown by methods of the subclass, except where those exceptions are themselves subtypes of exceptions thrown by the methods of the superclass. |
 | | Such a function violates the open/closed principle because it must be modified whenever a new derivative of the base class is created. |
| en.wikipedia.org /wiki/Liskov_substitution_principle (296 words) |