Need Advice
I am not sure whether to build one class or to build three small classes. My problem is that there are three types of reports.
1. Report one has data from a single point in time with an accompanying chart.
2. Report two has data from multiple points in time with an optional accompanying chart.
3. Report three has data from multiple points in time with an accompanying chart.
Ok experts please give me your thoughts. I need your advice so that I can make a good coding decision.
[511 byte] By [
Rachel_Ka] at [2007-11-27 0:00:10]

*FLAG ON THE PLAY - Insufficient information provided*
These three reports, are they the same data used in different ways and presented differently?
I'm going to potentially disagree with George here if they are not the same data. If it's all the same data and you're just using different criteria then I'd agree with him, if it's not then you may have multiple critters. Now, that said, in either case I would very likely create an interface that they have in common to keep consistency in my development and handling. If I was going to end up creating multiple classes I would most likely create a single super class that held the behavior that they have in common such as managing the connection(s) to fetch the data. To complicate matters even more there's another approach that you might find appealing, that being a strategy pattern.
A strategy pattern would be particularly helpful if you have the same data (with any criteria) that you want to display in multiple ways, this would allow you to use the same class to fetch and process data and call the strategy class that you need at the moment to handle your display.
As you can see it's not as cut and dried a decision as you may want it to be.
Hope this helps,
PS.
Message was edited by:
puckstopper31
For the items that show "multiple" sets of data, is that "one or more"? If so, could that not also be used for the simpler case?
As a design decision I would look for opportunities to reduce the number of classes to use through constructors and object state.
Obviously, you don't want to artificially create one class where two are necessary but if you need more than one I'd ensure that they were in the same class hierarchy as they'd probably inherit a lot of common functionality.