Replies: 1 comment
-
Yes, for queries you can skip a repository and database -> entity -> dto mapping and just do a database -> dto mapping right away, skipping the entire domain/repository part (if you don't need to execute any methods from an entity, like calculating something). Update: I refactored a query handler in this commit 92515cf |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Looking into this find-users.query-handler.ts query handler i noticed you were using the user repository for fetching the users.
Since on the read side we're not looking into enforcing any business rules, like we are on the command/write side with Aggregates, is there a reason for using repositories?
For example if we were to have a
Post
aggregate andComment
entities within that aggregate there'd be no point in building out eachPost
and fetching all of itsComment
relations when fetching something like a list of all posts.I couldn't find much on this online but i found this blog post which might explain this better than i can.
Btw, great work on the repo <3
Beta Was this translation helpful? Give feedback.
All reactions