Abstract

Both the Liskov substitution principle (LSP) and Meyer programming by contract (MPG) are powerful and useful mechanisms to ensure semantic compatibility of subclasses with superclasses. When applied, they lead to more correct inheritance hierarchies that are easy to understand and extend. However, the interaction between these tools might lead to contradictions and might prevent legitimate inheritance hierarchies. We show that some real-world class derivations may violate LSP and MPC principles. We discuss the interaction between LSP and MPC mechanisms and other inheritance constructs. The article tries to answer the question whether or not LSP and MPC are adequate tools to guarantee good class hierarchies.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call