This is more of a software design question, but it is being implemented in perl, so hopefully not too OT.

I have a class called DataManager which is a reader and/or writer for some specific types of data that our company deals with. (the format is immaterial to this discussion). I also have a collection of funcitonal programs that do a variety of reports on the data, but dont currently use the DataManager. This is a side effect of 2 programmers (myself being 1) not coordinating our projects very well in the past, and various shortsighted, partial upgrades.

I am creating a collection of reporter classes so that our data processing cycle can run more smoothly, and all have a common codebase.

So the real question is this. The reporter modules will be general enough that they can be used for things other than what the DataManager specifically deals with, so i am struggling a bit with the interaction between the reporters and the DataManager.

The Reporter will need to be fed the records in the DataManager in one way or another. One thought is to have the DataManager feed the Reporter directly, but if i do this, other things that use the Reporter will need to have their own methods to spoon-feed the Reporter.

Also, i could have the Reporter know how to get the data out of the DataManager and let the Reporter get the data itself. This sounds like a very bad plan, because then the Reporter will be forever tied to the DataManager - so no.

The third thought is to have no direct interaction between the 2 parts, and have an interface function that coordinates the 2. Then a different interface function will be needed for other DataManager like modules.

The first and third ideas dont seem very different to me, and im leaning toward the first, but i think i might not be seeing the whole picture yet.

I hope my question is clear, ask for clarification, flame me, whatever. Thanks :)

In reply to Designing a thin interface by shemp

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.