Week 9

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:

  1. 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.
  2. Methods Rule. Calls of these subtype methods must “behave like” calls to the corresponding supertype methods.
  3. Properties Rule. The subtype must preserve all properties that can be proved about supertype objects.

The Codeless Code

courses/cs203-201301/week9.txt · Last modified: 2013/04/03 10:31 by mlsmith
VCCS Top Events Extended Site Search Login Vassar Science Web Vassar Home Driven by DokuWiki Valid XHTML 1.0