Corrected class hierarchy of LiskovSubstitutionprinciple.
违反Liskov替换原则类结构图。
2
All of that is possible, but only if you follow a related principle: the LiskovSubstitutionprinciple.
所有这些都是可能的,只要你能够遵循一个相关的原则:Liskov替代原则。
3
Roughly stated, you are following the LiskovSubstitutionPrinciple if you can use any implementation of an abstraction in any place that accepts that abstraction.