C
C#16mo ago
M B V R K

❔ Could we Replace the Repositories by CQRS in DDD?

@Architecture Hi friends, my question is very simple. As a noob in DDD (Domain Driven Design), I think to replace the Repositories in the Appliciation layer by CQRS Commands and Queries. Note: The whole project I'm working on will implements the following concepts: Microservices DDD CQRS Event-Sourcing in addition I use the EF Core as the main O/RM inside the Infrastructure From your experience What do you think about this idea ?
6 Replies
phaseshift
phaseshift16mo ago
well, what do you call the thing that accepts events and saves the events into the db?
M B V R K
M B V R KOP16mo ago
Repository ? I understood what do you mean by you question and yoou're right, but the main cause that make me ask this question is in my CQRS Queries and Commands, lets say for example CreateOrderCommand this command will need the OrderRepository, PproductRepository, CustomerRepository and InventoryRepository and also other repositories, this will lead to that Command will need many repositories objects, while if I keep it only needs the EF Core DbContext object. I know that Repository is a DDD Domain concept, but I'm just need others to share with mee what they think about this case and their exppeiences and massive thanks in advance
Tvde1
Tvde116mo ago
what's the goal of a repository? does that still give value in your project?
M B V R K
M B V R KOP16mo ago
it can take Domain entities and convert them to their equivalent Infrastructure / EF Core entities and vice versa, it use EF Core's DbContext to insert and retrieve from database
Tvde1
Tvde116mo ago
what value does that abstraction give you in CQRS event-sourcing? when I have command handler, I omit repositories. Migrating would be handler-by-handler you choose repositories to make it easier to switch DB implementation
Accord
Accord16mo ago
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.
Want results from more Discord servers?
Add your server