![]() And my command side would evolve to a NewRunCommand and Handler that would create and populate a NewRun domain object then persist the information to the data store. Instead, it would perhaps go directly against the data store and always be denormalized. However, when looking at CQRS, the query would not hit the same repository. When a user wants to view the list of current runs, I query the same repository and return a denormalized DTO representing the information. According to Fowler ( here), a repository "mediates between the domain and data mapping layers, acting like an in-memory domain object collection." So, for example, in my Courier Service application, when a new run is submitted, my application service creates a new Run aggregate root object, populates it with values from the request then adds it to the RunRepository before calling the Unit of Work to save the changes to the database.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |