DDD C # - On which layer should I implement the data export part

0

I am developing an application in C # and WPF, with several registers such as Customers, Suppliers, Products, etc. I am using the DDD concept and am having a question about how to implement a data export module. I will need to export data and the files will be in xml, csv and txt format.

On which layer do I implement this module? Does anyone have an example?

    
asked by anonymous 08.07.2017 / 17:01

2 answers

1

I assume that this reporting module will use some Frameworks to generate these Excel (EPPlus example) and PDF (example ITextSharp), so it is interesting to create this in the CrossCutting layer to decouple these Frameworks from Application Layer. If one of these Frameworks becomes obsolete one day or you want to make another, then my business rule layer will not be changed.

The CrossCutting layer serves exactly for system modules that influence other modules, such as persistence layer, services, etc. As an example of things done in the CrossCutting layer are security module, LOG system, and also for case of your reports.

    
05.10.2017 / 22:25
0

Well, the "correct" (depending on the case), would be put in the Application, because theoretically you have to pass in the domain to export consistent data and the layer that has the business rules that consists the data is the Domain. So the normal thing would be to have this responsibility in the Service layer (not the domain service), not in the data layer, nor in the business layer (domain), depending on how you are going to export it could be in the presentation.

If you do not understand or want more details, just call ...

ps: If you want to know more about these issues of where to put and how to do I recommend the implementing Vaughn Vernon's domain drive desing ... abrs

    
05.10.2017 / 22:06