DEV Community

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

Collapse
 
marconicolodi profile image
Marco Nicolodi

I thinks its a repository, since its getting data from a persistance store (the filesystem). You should call the repository method within an application service which orchestrates your use cases.

Collapse
 
buinauskas profile image
Evaldas Buinauskas

This.

Collapse
 
piczmar_0 profile image
Marcin Piczkowski

?

Collapse
 
piczmar_0 profile image
Marcin Piczkowski

It would make sense if it was really getting data from any storage, but I get it from file uploaded by user to my rest controller. It's in-memory, not in file system.

Collapse
 
marconicolodi profile image
Marco Nicolodi • Edited

So i think you should parse it using a service/utility class, call this class within your controller, and pass the returned user objects as an usual parameter to your application service class, which would orchestrate your use case without knowloadge about the file. Treat the file as a controller parameter/input, despites the fact that your framework probably doesnt parse it by default.