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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.