How does strengthening of preconditions and weakening of postconditions violate Liskov substitution principle?
https://softwareengineering.stackexchange.com/questions/187613
-
05-11-2019 - |
Pregunta
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 hay solución correcta
Licenciado bajo: CC-BY-SA con atribución
No afiliado a softwareengineering.stackexchange