Timeline for In DDD, how can repositories be optional?
Current License: CC BY-SA 4.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 11, 2023 at 11:57 | comment | added | guillaume31 | Besides, I don't understand why you say repositories bundle the operations [all of the interactions (commands, queries) ]. No variant of Repository has ever bundled any command like CancelOrder, SendShipment, ThumbsUpComment, etc. AFAIK. | |
| Aug 11, 2023 at 11:56 | comment | added | guillaume31 | I will not show it because Jimmy Bogard, author of the quote in OP, shows it at length in the blog posts referenced in my answer. For him Aggregates are the crux of the matter, a huge part of why Repositories conflict with CQRS in his opinion. | |
| Aug 11, 2023 at 11:53 | comment | added | Flater | @guillaume31: Unless you can show me the that this kind of DDD-specific repository pattern explicitly prescribes using only a single query or command per type in the same way that CQRS does, the distinction you're pointing at simply doesn't matter here. I'm not saying the distinction doesn't exist when discussing the overall codebase, I'm saying it doesn't make a difference with regards to the actual focus of this particular answer. | |
| Aug 11, 2023 at 11:50 | comment | added | guillaume31 | First sentence of section 1 in the referenced Microsoft article: The Repository pattern is a Domain-Driven Design pattern. This makes me think OP had DDD in mind and in that context, the type of repository matters. The text excerpt quoted by @MyUsername112358 also mentions Aggregate roots. It makes a huge difference whether your Repository only deals with Aggregate roots or not. | |
| Aug 11, 2023 at 11:41 | comment | added | Flater | @guillaume31 You're going well beyond the current question's context here. The comparison was between a repository and CQRS, where CQRS dictates a separation that repositories do not. Splitting hairs over the exact type of bundling is beside the point I was making that a repository bundles things more so than CQRS prescribes. As the second to last paragraph points out DDD does not factor into this particular consideration. Yes, DDD makes some difference here for the overall architecture and syntax, but not in a way that it meaningfully changes the considerations listed in this answer. | |
| Aug 11, 2023 at 8:43 | comment | added | guillaume31 | -1. Unless the Repository pattern has morphed beyond recognition since last time I looked, I disagree with that description. Repository is both an older OO pattern and a DDD pattern, but OP and the Microsoft article refer to the latter. Saying that it bundles all of the interactions (commands, queries) is a very far fetch. Firstly Repositories only deal with Aggregates. Then there are two implem traditions, one that acts as a mere collection and another that is a bit closer to storage but certainly doesn't map to all of a system's Commands (see "Implementing DDD", V. Vernon, p.365). | |
| Aug 11, 2023 at 1:44 | history | answered | Flater | CC BY-SA 4.0 |