Thanks, that does help. I had something similar worked up for the constants, but missed the idea of having the function that accesses the data in the subclass, instead of in the parent. So I can work with that. One question, what's the value of the methods in the parent like find_fur_texture, vs. simply calling the method from the child directly? Also, one of the things that concerned me when reading the warnings about inheritance was the idea of calling the methods by name (ala, Monks::Data::get_texture) as opposed to something more abstract. But maybe I'm missing something? And finally I am definitely keeping the goal of keeping the public interface and the internals separate. :)
In regards to the last bit, one example would be a 2d hash with a bunch of compiled regular expressions that I'm using to parse the data that the module deals with. So something like this:
if (not defined $Monks::Parsers{ $self->{thing} }) { $self->{parser} = 'Generic'; }
And:
foreach my $key (keys %{ $Monks::Parsers{ $self->{parser} } }) { dostuff; }
Does that make sense?
In reply to Re^2: OO manner of accessing static variables in a subclass?
by HipDeep
in thread OO manner of accessing static variables in a subclass?
by HipDeep
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |