jeudi 29 janvier 2015

Object oriented logic with different types for a report

I want to create report mechanism with object oriented design patterns. I want to create a report generator. Reports can be PDF , Wrod, HTML. So I created an interface like this:



interface IReportGenerator{
Report Generate();
}

class PDFReportGenerator : IReportGenerator{
public Report Generate(){
retrun ******;
}
}


But I have many type of reports. FeaturedProductsReport, MostActiveCustomersReport, BestSellerReporst, etc.


Each type of report is different parameters. So I could aggregate them. How can I do object oriented design these logic?


Aucun commentaire:

Enregistrer un commentaire