第一种定义: 如果对每一个类型为S的对象o1,都有类型为T的对象o2,使得以T定义的所有程序P在所有的对象o1都代换为o2,程序P的行为没有发生变化,那么类型S是类型T的子类型. 第二种定义: 所有引用基类的地方必须透明的使用其子类的对象.(Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it.) 第二种
Attribute selectors are a particularly helpful subset of CSS selectors. They allow us to specify an element by one of its HTML attributes, such as a link's title attribute or an image's alt attribute. 属性选择器是一个相当有用css选择器的子集. 它允许我们通过一个元素的html属性去明确一个元素,
里氏替换原则(Liskov Substitution Principle LSP)面向对象设计的基本原则之一. 里氏替换原则中说,任何基类可以出现的地方,子类一定可以出现. LSP是继承复用的基石,只有当衍生类可以替换掉基类,软件单位的功能不受到影响时,基类才能真正被复用,而衍生类也能够在基类的基础上增加新的行为. 如此,问题产生了:“我们如何去度量继承关系的质量?” Liskov于1987年提出了一个关于继承的原则 “Inheritance should ensure that any pro