How does strengthening of preconditions and weakening of postconditions violate Liskov substitution principle?
https://softwareengineering.stackexchange.com/questions/187613
-
05-11-2019 - |
Question
I read that Liskov's substitution principle is violated if :
Preconditions are strengthened, or
Postconditions are weakened
But I don't get fully yet how these two points would violate Liskov substitution principle. Can some one please explain with an example. Specifically, how would any one of the above conditions cause a situation where a subclass object can not be substituted for a superclass object?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with softwareengineering.stackexchange