Jump to content


Photo

Design Pattern Choice


  • Please log in to reply
No replies to this topic

#1 RobLockett

RobLockett

    New Member

  • Members
  • Pip
  • 1 posts

Posted 08 October 2012 - 11:23 AM

I have a C# 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<Bogus> as a parameter
Report 2 might take List<Interesting> 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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users