I�ve been working on a reporting engine for in-house
(since we�re turfing Crystal finally). I haven�t had trouble modeling my
supporting services/components (i.e. CSV output utility etc) but I�m having a
helluva time trying to figure out how to model the most important part, the
reports! LoL
First time around I�m trying to keep it
simple�essentially have a generic �Report� object which then gets extended for
each new report we create. Each report is just a sql query with optional
search parameters (the reports �properties�)�meaning the statement is built
using a bunch of cfif statements.
Since I�m stuck trying to bang out the model, I
thought maybe it�d be easier to imagine how I�d actually want to leverage this
engine in the scope of an application:
<cfset reportManager =
CreateObject(�component�,�ReportManager�).init()>
<cfset report = reportManager.generate( reportType,
attributeCollection, persistanceLevel )>
But I�m trying to avoid a situation where every time
we need to add a new report, we have to make changes to the manager AND extend
the Report object with another subtype. I�d like to be able to just drop in
the new subtype and have it work straight away.
My first thought was to have the manager evaluate the
reportType attribute and attempt to invoke a CFC of the same name. This CFC
would extend the Report object and have its own �query� method for its
specific DB work.
Am I way off here? (or making any sense for that
matter ;) � I haven�t even begun to think about adding a persistence mechanism
for recordsets used in a display. (cached so user can browse quickly without
re-querying)
Any pointers appreciated!
Stace