| Next | February 2001 | Slide #37 |
It's important to design classes so that they can be inherited from
Otherwise you lose a big benefit of OOP
To test, use the Empty Subclass Test
Make a subclass of your class that adds nothing new:
package Fake;
use base 'Person';
1;
Then see if a Fake object behaves just like a Person object
It should support all the Person methods in all the same ways
Rule of thumb: A class should usually not mention its own name
| Next | ![]() |
Copyright © 2001 M-J. Dominus |