DEV Community

Discussion on: Is file parsing a domain operation in DDD?

 
piczmar_0 profile image
Marcin Piczkowski

Can you give more explanation why this is better to put CSV parsing in use-case service? Why not in higher layer. E.g. I could get batch data from various sources, e.g. JSON list via rest controller in addition to CSV upload and if I had parsing or JSON conversion to a list of domain objects outside of my use-case service I would not need separate use-case methods for each of these but just single method taking a list of domain objects.

Thread Thread
 
chenge profile image
chenge

Make it as a usecase, name your 3 source as controller, and call the service. How about this?

If you like put it to your domain class I think is OK.

You could see Clean Architecture picture by Robert Martin.