Store media in a domain entity

101 views
Skip to first unread message

Sean Farrow

unread,
Oct 27, 2017, 2:43:39 PM10/27/17
to ddd...@googlegroups.com

Hi all,

 

I have a requirement where I need to optionally store a piece of media in a domain entity.

 

I can think of several ways of doing this:

Firstly, have the command that is kicked off when the REST API is called upload the media to a filesystem then store the details as a value object in the entity firing an event when this is stored to update the read model.

 

Or secondly, Add the media to the entity as a byte array, but then I’m storing media in an event which doesn’t sound good, so my question would be how do I upload the data to a filesystem and transform the result to a bwetter representation within the the domain, is a domain service the best fit?

 

 

Finally, is there a better more CQRS centric way to do this?

Any help appreciated.

Kind regards

Sean.

 

Greg Young

unread,
Oct 27, 2017, 2:44:37 PM10/27/17
to ddd...@googlegroups.com
Upload to something like s3 then keep a link?

--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/dddcqrs.
For more options, visit https://groups.google.com/d/optout.



--
Studying for the Turing test
Reply all
Reply to author
Forward
0 new messages