I have a design pattern conundrum that I can't quite figure out, so I was hoping that maybe someone in the group could help me out (and hopefully I'm going about it the right way and asking the right questions).
I'll try to give as many technical details as I can without violating any NDA's, but basically I'm writing a reporting engine which runs different types of reports, stores them in a WDDX format, and then you can call the results of the report in which a Display Manager converts the WDDX into a display format such as HTML, PDF, etc. One of the problems with this report is that it queries around 30-40 different databases, and the layout of those databases change on occasion. That said, I version each of the reports which are generated into WDDX and match a display version up with them. I.e.-- every time a database changes, I bump up the current version of the display layer and create a new CFC which I apply the changes to which is named the same as the version number. Essentially a display manager component works as a fa=E7ade and invokes the proper CFC based on version when a display is requested. This way old reports can still be rendered and displayed even though their format does not match the current one. This is code is not released into production yet, but I have something that is relatively close to complete at the moment. However I'm in the process of refactoring the whole project. One thing that I really don't like about the current design is having to stick all of the display logic in one huge CFC just because I need to have different versions of the display so that old reports will still be viewable. I'd like to break all of that apart, but at the same time I don't want directories and directories of code which are all very similar but different versions which is the only way I can think of to do this offhand. Anyhow, I'm hoping to switch this display part of the reports to use a decorator pattern because different report types do share some of the same types of data, but I can't quite figure out how to fit in versioning of the display. Here is the "is a / has a" premise that I'm working from: ReportFactory -> DisplayFactory -> ReportType -> Report -> Report Version -> Display Format -> Report Section -> Query Here are the descriptions for each of these objects: ReportFactory: A fa=E7ade for the various Report specific functions within a bigger application DisplayFactory: A fa=E7ade for the various functions to display a report within the ReportFactory ReportType: Handles the general formatting and data which is in the report.. i.e. the Sales Report should include these X queries Report: Retrieves the WDDX of the requested report, and puts it in a shared object/scope for the object down the line to use. Report Version: Defines how we need to display this report based on the data structure within the WDDX object Display Format: Do we need to format this in PDF? XHTML? etc. Report Section: A section within the report which contains various query results.. sort of like a group of related queries Query: A display object for an individual type of query. Does anyone have any ideas about how I would go about doing internal display versioning? I'd think it would be something along the path of faking method overloading, but I'm still not quite sure if I'm going down the right path. Let me know if I'm leaving anything out, not asking the right questions, etc. Thanks, - Brandon -- ---------------------------------- http://devnulled.com ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
