I'm building an asp.net report application. Ideally all reports would be generated by a single page by specifying the report name in the querystring (e.g. reportName=MonthEnd). This page would use a factory to return an instance of the specified report:
- ReportFactory.Create(ByVal reportName as String) as IReport
I'm thinking of having a set of interfaces (e.g. IDateRange, IFooter) which report classes could implement as required. However, I can see that my client code (ASP.NET webform) will need to perform checks to see if a particular interface is supported by the IReport object (returned from the factory). For example, if IDateRange is supported then display the date range controls on the form.
Surely there must be a more elegant OO solution?