Will all things being equal, you do whatever makes best sense to you.
You're the one who is most likely going to be maintaining it, and making things so that they make sense to you, and will be easy for you to maintain.
What makes sense for someone else may not make sense to you. Yes, there's the concept of 'best practices', and 'best' is an ideal that is rarely realized.
That being said, what makes sense to be is to divide them up into modules of specific functionality (because it's easier to maintain, in my opinion), and then to make a super class that inherits all of the commonly used modules (just because I'm lazy), and possibly that functionality that didn't fit into a nice little container, but was widely used.
Of course, because I'm using mod_perl, I don't have to worry about the overhead of loading modules when they're not needed.
So, I guess with the choices you've given, I'd use a blend of #2 and #3 (maybe even some of #1). As for when you draw the line between #1 and #3 (use vs. inheritance), I'd think it's just a matter of how you think about your problem -- depending on where you place a sub system's boundries can affect what is considered inherited, and what isn't.
In reply to Re: Code reuse and method sharing with OOP / CGI::Application
by jhourcle
in thread Code reuse and method sharing with OOP / CGI::Application
by jeyroz
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |