里氏替换原则
来自维基百科,自由的百科全书
在面向对象的程式设计中,里氏替换原则(Liskov Substitution principle)是对子类型的特别定义。它由芭芭拉·利斯科夫(Barbara Liskov)在1987年在一次会议上名为“数据的抽象与层次”的演说中首先提出。[1]

里氏替换原则的内容可以描述为: “派生类(子类)对象可以在程序中代替其基类(超类)对象。” 以上内容并非利斯科夫的原文,而是译自罗伯特·马丁(Robert Martin)对原文的解读。其原文为:
- Let be a property provable about objects of type . Then should be true for objects of type where is a subtype of .
引用
参考文献
参阅
外部链接
Wikiwand - on
Seamless Wikipedia browsing. On steroids.