Tuesday, December 1, 2009

Class Versus Interface Inheritance

From "Design Patterns Elements of Reusable Object-Oriented Software" 
1994

There is a difference between a object's class and its type.

Class defines how an object is implemented.

Type defines its interface or the set of requests to which it will respond.

Class inheritance defines an object's implementation in terms of another object's implementation.  A mechanism for code and representation sharing.

Interface inheritance defines or describes when an object can be used in place of another.