|
|
| Do you know where your variables are? | |
| PerlMonks |
Re: CGI::Application, inheritance trees, and 'the right way'by FoxtrotUniform (Prior) |
| on Nov 01, 2004 at 22:44 UTC ( #404446=note: print w/ replies, xml ) | Need Help?? |
|
It sounds like SiteManager.pm is a repository for utility code. If that's the case, then it shouldn't inherit from CGI::Application. Going by the names you have, it sounds like EventManager and EmailManager aren't really kinds of SiteManagers; maybe all three are Managers. Inheritance should model "is-a" — if the child class doesn't quite fit, don't force it. That way lies madness. Don't inherit from a superclass just for code reuse: there are plenty of good ways to reuse code; inheritance is one, but building libraries with clean interfaces is perfectly good, too, and doesn't complicate your life with weird dispatch semantics. If you have to ask "Should foo really subclass bar?", the answer is probably no. --
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||