I am rapidly learning about Perl's Object Oriented features. Right now I want to write a module that has some 'common methods' that I would like to be able to inherit in other modules. For example:
I have a Tk based programme. In it I have created whole sections of the UI as objects and this has worked well. But I now find that some parts of these various UI's are common to each other, particularly things like listcmd and browsecmd methods for BrowseEntry's for example.
How do I handle this?
Do I put the methods in a module called, say "handy_methods" and inherit it using @ISA = qw( handy_methods );?
Then I assume that once 'inherited' that the methods have access to the attributes of the blessed hash? So that I can directly refer to attributes rather than having to pass references into the method.
I am reading chapter 6 of thedamian's book on Object Oriented Perl but I am getting a little lost in here!
In reply to Help me understand inheritance please! by jdtoronto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |