Hey all, yet another design question for something im implementing in Perl. I have a class called DataReportManager which contains a collection of TableReporter objects. The TableReporter objects each contain a collection of RecordReporter (and family) objects.
I am not quite sure where to store certain pieces of data, such as the table names being reported on. (this is crunching data from MySQL).
The DataReportManager references its TableReporters using the table name, (a hashref). The TableReporter objects should probably store the table names because the table name is certainly part of what the TableReporter needs to know about. But the DataReportManager knows when to use which TableReporter. The DataReportManager reporting input params are the table name and a row, which are processed one at a time.
Finally after the dataset has been analyzed, the reports are generated. The table name is needed for the reports, and the RecordReport objects create the reports. So part of me says that each RecordReporter should store the table name, but the TableReporter could just pass it in when it coordinates the RecordReporter's to generate the reports.
So where would people store the table names in this situation?
Sorry for the long post for something thats probably really obvious. Or is this really a style issue?
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.