laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Okay, this clears a bit of the mist in my head. Blessing into whatever class I want is certainly, err, what I want. Your example of having an init() method is something I'll have to incorporate into my code; you're right on it being easily understandable.
I also notice that you went with Utils and Utils::LowLevel rather than my Utils and LowLevelUtils - obviously I'm still learning the basics of designing a useful package hierarchy.
Now I have a question of laziness. Having re-arranged your code a bit:
If I add into Utils and Utils::MidLevel, then the $util and $mid objects can both find the foo method. Now, if I'm pig-headed and am dead set against adding those kinds of stubs into Utils and Utils::MidLevel and similarly want to have Utils and Utils::MidLevel be able to access lower-level methods in this manner: rather than
Well - can I have my cake and eat it too? That is, can I keep Utils aware of methods in Utils::MidLevel aware of methods in Utils::LowLevel without having to go through double-colon acrobatics (plus calling methods as regular functions)? I'm guessing the answer to the above question is no; without stubs and without calling the methods functionally, there is no way to do what I want - just thought I'd ask on the off chance that there's a crafty way to do this. :) Sorry if this post is hard to read due to incorrect usage of OO terminology (or other CompSci terminology for that matter) (Good catch on extending Utils with Utils::MidLevel, btw. I have been thinking, "Gee, this really isn't really a low-level table action, nor a high-level action... it's more mid-level...")
blyman In reply to Re: Re: Faking new() method in high-level package
by belden
|
|