in reply to Help me understand inheritance please!
A utilities module shouldn't contain any references to the innards of any object. It should literally be a bunch of subs along the lines of:
These are subs that do something useful, but are completely atomic - they don't have any reference points outside themselves.sub min { $_[0] < $_[1] ? $_[0] : $_[1] }
Now, you mention listcmd and browsecmd. I don't know Tk, but it sounds like they both deal with commands, in some sense. So, maybe you don't actually have inheritance as much as delegation. Have you considered abstracting out some cmd object and having listcmd and browsecmd both contain an instance of cmd?
From what I'm guessing, the list part would be inheritable. So, let's say you had a listfoo and a listbar. You would have a list baseclass that both would inherit from, plus foo and bar classes that they would delegate to.
DOes that make sense?
Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.
|
|---|