Which model should be used to process reports in the infrastructure to allow different views?

Just start learning patterns. Here is a simple question that I have.

I have an object Reportthat contains Pages, each of which contains a variety of ReportElement( Table, Paragraph, Image), and so on. Suppose I want to create an infrastructure for adoption Reportand spit on various representations of this Report, such as an RTF document, a TeX document, an HTML document, etc.

What design template am I looking for here?

+5
source share
4 answers

Strategy I believe.

RTFReportGenerator, HtmlReportGenerator .., IReportGenerator, WriteReport (Report r) .

+10

Visitor. , , , .

+1

. , . , . ​​ .

, .

- . ( ). (BasicView < | - RTFView, TextView...) BasicView. .

0

Composite , Visitor ( ), .

0

All Articles