Some of these kinds of problems, it never feels like there is a good solution. What I would probably try if it were my row to hoe is to just start writing unit tests, definitely not system tests, with the intent of just sketching, not trying to do finished work or even tests you'll necessarily keep. That forces the thing down to atoms and “I wish I could just do *this* instead!” and that might give you insight as to what belongs where and why; in practical instead of theoretical/philosophical terms.

I don't think there is a best practice here. I think a lot of large projects full of concerns that should have been separated get so balled up that they can never get split up properly. Every step into that world requires two steps to back out. The code base at work is a testament to this. I honestly think a total rewrite would be easier than realigning 20 years of disparate but deeply interdependent code.

FWIW, I'm playing around with my own micro-web-framework right now and it's my… probably fifth run at it. What is helping me decide how far to go or not go is trying to write consuming code and make it testable. Might just be another learning exercise in the end though. :P


In reply to Re: Refactoring complex module into set of specialized sub modules? by Your Mother
in thread Refactoring complex module into set of specialized sub modules? by LanX

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.