The answer to the question In CQRS, should my read side return DTOs or ViewModels? suggests that there should be one ReadModel (or projection, I am assuming these are the same) per widget.
But if this is the case, then does that not move the QueryHandlers into the presentation layer, so that there would be one QueryHandler per widget (in my case components in Angular)?
More specifically: Are QueryHandlers supposed to have functions like getReadModelForProjectPageSidebarById(< projectId >)
or are they supposed to have functions like getProjectById(< projectId >)
? If the latter is true, wouldn't that mean that an additional layer would be needed to map the ReadModel to a ViewModel that the widget/component could use?
Aucun commentaire:
Enregistrer un commentaire