Replies: 1 comment 2 replies
-
I didn't say there has to be 1 controller per 1 endpoint, just that modules and use-cases have to be grouped by functionality. How to group them is up to you. You can create 1 controller per module if you prefer and put all endpoints there. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I really appreciate this document and trying to stick to it, but when I ask ChatGPT about one controller per command/query (in your words it's per "use-case"), it recommends grouping the routes together to have one or a few controllers per module as opposed to essentially one for every endpoint.
Wouldn't there be a bit of a performance impact if I had hundreds of controllers since I have hundreds of routes for example? Or is the clear vertical slice a high priority and sufficiently beneficial so we should stick to having one http controller for each command/query over performance/overhead concerns?
Just wondering if you could provide some more commentary on this.
As a basic example... from copying your repo and reading the document, it would seem we should have one http controller for each of the routes below?
So out of all the possibilities:
a) 2 controllers - 1 for auth, 1 for mfa
b) 3 controllers - 1 for auth, 1 for oauth, 1 for mfa
c) 15 controllers - combine them in each of their modules when registering it and it's okay to have hundreds in the whole app
To clarify, you would still recommend (c) right? @Sairyss
Beta Was this translation helpful? Give feedback.
All reactions