I am very new to CQRS / DDD, so there can be big holes in my understanding.
But suppose I have a collection of objects Widget
. Widget
consists of objects Note
, and objects Note
can have an object attached to them File
.
In CQRS, I can have a command called AddNoteToWidget
. From my reading, I know that both command objects and events should be simple DTOs (I know that they can also come in other forms, but the main thing is that they do not contain behavior).
I also understand that entities should never contain references to repositories, as they must be unstable.
Will mine AddNoteToWidget
contain an object reference File
and just serialize along with the command? If so, then my object File
should be an object of value. However, I modeled it as an object with its own repository, because I wanted to have a central consistent file storage throughout the system.
source
share