====== Week 9 ====== ~~NOTOC~~ ===== Type Hierarchy ===== //**Liskov Substitution Principle: **// //objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.// The //substitution principle// requires that the subtype specification support reasoning based on the supertype specification. Three properties must be supported: - //Signature Rule//. The subtype objects must have all the methods of the supertype, and the signatures of the subtype methods must be //compatible// with the signatures of the corresponding supertype methods. - //Methods Rule//. Calls of these subtype methods must "behave like" calls to the corresponding supertype methods. - // Properties Rule//. The subtype must preserve all properties that can be proved about supertype objects. ---- * Liskov Ch. 7 * Lecture notes: {{courses:cs203-201301:ch7-type-hierarchy.pdf|PDF}} * Wikipedia article: http://en.wikipedia.org/wiki/Liskov_substitution_principle ===== The Codeless Code ===== * The Backwards Monk: http://thecodelesscode.com/case/44 * What does this mean to you?