in reply to Getting parent class data
I think you mean something more like this:
And yes, this is a perfectly acceptable approach, notice I did not say "quick hack" because I don't honestly see anything wrong with this. As long as you thoroughly comment this, and always stick to that nameing convention (which is a good thing to do in a framework anyway), you should have no issues.my @_isa_parts = split '::' => ref($self ); pop @_isa_parts; # pop off the ::DB stuff ... my $LoggerClass= ((join "::" => @_isa_parts) . "::Debug");
Of course, the moment you step outside of the boundries of your naming conventions, it all falls apart. But even then the breakage is in a single place (the function which contains the code above), and you shouldn't have too much trouble fixing it.
Remember, encapsulation and convention are your friends when build or working with code frameworks.
|
|---|