The notion was familiar, but I hadn't seen this formalized until I was reading "An Introduction to Object-Oriented Programming", by Dr. Timothy Budd.
A "subclass" is simply a child class--a class that inherits behavior. A "subtype" is a subclass that could be substituted for the parent in any instance with no change in behavior. This idea that the child class should be substitutible for the parent is know as the "Liskov Substitution Principle."
An interesting argument is that useful applications of inheritance do not violate this principle, whereas dangerous applications of inheritance do. So, inheriting from a class simply to re-use a lot of the code while changing the fundamental behavior of the class, is largely considered a bad idea. Whereas using inheritance to make a more specific kind of thing is a good idea.
Posted by enigma at January 26, 2004 12:17 PM