in reply to Re^2: How to name a subclass of an object class?
in thread How to name a subclass of an object class?
If this were a b&d language, you'd have both Number and NumberSet implement an interface which simply defines one method returning the "current"/"total" numeric value. Because this is Perl, you only need to have the two classes implement that method, without any explicitly defined interface. Then, in any situation where you'd call that method, as long as the object is of one class or the other, you're good to go.
And certainly, from what you've told us, the two classes don't need to be related in the class hierarchy at all.
|
|---|