I have legacy Reporting Engine class that is responsible for 50+ reports with a single method CreateReport(Guid reportId, ReportParams params);
Reports require 12+ of different parameter types (Guid, int, bool, enumerations) and their combination. For example:
- Report #1: No parameters are required
- Report #2: 2 Booleans (checkboxes populate by user)
- Report #3: Guid (personId) & integer (year to start with)
- Report #4: Guid (personId) & PersonType (enumeration)
ReportParams is a class with 12+ properties and arrays that are populated before calling the method. But most of them are unused per call. Report Engine class checks that appropriate properties are populated and uses strong type information access.
Everything was ok until I decided to make reporting engine WCF friendly. Every time I add new parameter type I have to rebuild server, update proxy (that leads to clients reinstall), and make sure that ReportParam structure is converted correctly between WCF-friendly version and Reporting Engine version.
I wonder how to minimize all this conversions, checks, client reinstallations e.t.c. May be I shall refactor ReportParam to XML document? It will make proxy stable, ReportParams wcf friendly, but I'll have to refactor strong type information access in the Report Engine class.
What will you suggest?