If a class D is "just like" a class C except for extensions, then it should be possible to use a D object anywhere you an use an C object. That is, a child should be able to be used where ever the parent can be used.Design Principle: Suppose class D is derived from class C. Then derived class D is-a C. That is, whatever an object of super-class C can do, so should an object of sub-class D.
Design your classes to preserve this property unless you have a strong reason to do otherwise.
|
|
|
|
|
|
19. Object-Oriented Class Design Principles Tangible Computing / Version 3.20 2013-03-25 |