Software engineer with over 10 years experience in different technology stacks, architecting, developing, CI/CD and leading teams. Currently working with Java, Node.JS and Serverless
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.
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.
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.