O'Reilly Forums: Design Pattern Choice - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Design Pattern Choice

#1 User is offline   RobLockett 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 08-October 12

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users