I have a class library that is responsible for generating reports. Each report consists of the following:
- Header
- Body
- Footer
Some of the reports have the same header / footer. None of the reports have the same body.
The body component is generated by taking a parameter which stores the data that needs to be displayed. The type for the parameter varies for each report.
e.g. Report 1 might take `List<TypeOne>` as a parameter
Report 2 might take `List<TypeTwo>` as a parameter
What is the best way to represent the above using a design pattern. I have considered using a factory but am having difficulties with the body section as each report takes different parameters.
Thanks
RobLockett
0
Newbie Poster
Recommended Answers
Jump to PostIs it an option to create a type (class) that contains the available options? Can you provide some more details about the parameters?
All 3 Replies
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
skatamatic
371
Practically a Posting Shark
Momerath
1,327
Nearly a Senior Poster
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.