Have the DRM ask each TR if it wants to do something with a given table name. Basically, the DRM is a glorified array with a few methods. It should then delegate all execution of those methods to the TRs. It should ask each TR in turn if it wants to deal with the request that it received. As each TR does something (or nothing), the DRM will aggregate those results and return them to the client.
If I understand what you're doing, this will give you a few new features:
- You can have more than one TR handle a given table.
- You can now have a TR deal with more than one table at a time.
- You can now move the sorting into the DRM instead of in the TR. (I'm assuming you're doing this.)
- You can share RRs between TRs.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
I shouldn't have to say this, but any code, unless otherwise stated, is untested
| [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] |