Liskov substitution principle - Wikipedia, the free encyclopedia
Programmer topic, so those who don't care can just tune out now.
OK, for those that stuck around, I felt I needed to record this info because I keep forgetting what a Liskov violation means. Basically it pertains to whether a subclass can be directly substituted for one of its superclasses. If, for any reason, an object cannot be directly substituted as an instance of one of its superclasses then it should be considered a Liskov Violation. This came up at the beginning of this year on python-dev and it was pointed out that not making sure that the instantiation parameter signature for a subclass not match its superclasses was very evil.
No comments:
Post a Comment