It sounds as though the TableReporter has responsibility for knowing which table it is based on. I think the DataReportManager should not know that implementation detail, but rather have a collection of TableReporters that it just manages.
You may find the DBI dbhandle methods like data_sources() and tables() to be helpful.
| [reply] |
Maybe im not fully understanding you, but the DataReportManager needs to know which TableReporter deals with which table. This is becaue when the DRM is given data to report on, it needs to pass it on to the proper TR. I suppose i could have a TableReporter::WhichTable() method.
In any case the DRM does not know how the TR stores its name, but the DRM has a hashref of TR objects and the keys are the table names.
I am pretty sure im going with storing the name in the TR, and it can pass the name along to the RecordReporter as needed, which is currently only when the report is generated after all data has been analyzed.
Did i misunderstand you?
| [reply] |
| [reply] |
... the DataReportManager needs to know which TableReporter deals with which table.
Rather, it needs to be able to find that out.
So, iterate over the collection of TableReporters and ask them whether they deal with the given table. (If you're worried about performance, you can later add a cache of the results by table-name which gets cleared when more TableReporters are added, but don't optimize prematurely.)
| [reply] |