mercredi 22 juillet 2015

Which Design Pattern I should follow when passing different data type to a library?

I am creating a CSV export library where the input data will come from different source like we can have User data to be exported to CSV and we can also have Orders data to be exported to CSV.

I am thinking of creating a FeedCSVProcesser where we will prepare CSV from the input data.

The input data will be of defined type like for users it will be UserFeed, for orders it will be of OrdersFeed and all share common interface IFeedType. We can then use DI principle and have CSV to extract data from the IFeedType using reflection and prepare CSV. Is this approach right, as I am not sure what kind of design pattern I am following or what should be there.

Please guide ?

Aucun commentaire:

Enregistrer un commentaire