❔ Where should the CQRS be in the Clean Architecture?
Hello guys, hope you're doing well,
Please if I want to work with
Clean Architecture
and I want to use CQRS
, fromm your experience, should the Commands
and Queries
be in the App
layer or should the CQRS components
be separated in another layer ?
Thanks in advance :)5 Replies
I would separate data access methods to its own class library, there it can be referenced and used from other projects if added in future
X.Common.Application (common data transfer objects and enums)
X.Service.Application (business logic)
X.Entity.Application (data access)
What's even the appeal of clean architecture?
I see so many questions about "where does X go?"
I guess it depends how tightly you want the cqrs want to be in your application? If its the one and only communication method (or principle, however you call it) (im guessing it will be) then I'd put it somewhere near the "core" which means application layer in your case, then, it depends whether you will be reusing those models in some other applications, if so, you should separate them so you can publish nugets of them, if not then I'd say they would happily live in Application layer
It could be a bit hard to grasp at first, kinda like ddd, but I believe it has its place, maybe not in small apps. What kind of architecture appeals to you?
something akin to vertical slice is what I arrive at in my personal projects
CA just seems like an enormous amount of ceremony for little benefit
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.