Edition 0 Updated to asp. Net core 0


Repositories shouldn’t be mandatory



Yüklə 11,82 Mb.
Pdf görüntüsü
səhifə211/288
tarix12.07.2023
ölçüsü11,82 Mb.
#136458
1   ...   207   208   209   210   211   212   213   214   ...   288
NET-Microservices-Architecture-for-Containerized-NET-Applications

Repositories shouldn’t be mandatory
 
Custom repositories are useful for the reasons cited earlier, and that is the approach for the ordering 
microservice in eShopOnContainers. However, it isn’t an essential pattern to implement in a DDD 
design or even in general .NET development. 


244 
CHAPTER 6 | Tackle Business Complexity in a Microservice with DDD and CQRS Patterns 
For instance, Jimmy Bogard, when providing direct feedback for this guide, said the following: 
This’ll probably be my biggest feedback. I’m really not a fan of repositories, mainly because they hide 
the important details of the underlying persistence mechanism. It’s why I go for MediatR for 
commands, too. I can use the full power of the persistence layer, and push all that domain behavior 
into my aggregate roots. I don’t usually want to mock my repositories –
I still need to have that 
integration test with the real thing. Going CQRS meant that we didn’t really have a need for 
repositories any more. 
Repositories might be useful, but they are not critical for your DDD design in the way that the 
Aggregate pattern and a rich domain model are. Therefore, use the Repository pattern or not, as you 
see fit. 
Additional resources 
Repository pattern 

Edward Hieatt and Rob Mee. Repository pattern.
https://martinfowler.com/eaaCatalog/repository.html
 

The Repository pattern
https://learn.microsoft.com/previous-versions/msp-n-p/ff649690(v=pandp.10)
 

Eric Evans. Domain-Driven Design: Tackling Complexity in the Heart of Software.
(Book; 
includes a discussion of the Repository pattern) 
https://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-
Software/dp/0321125215/
 
Unit of Work pattern 


Yüklə 11,82 Mb.

Dostları ilə paylaş:
1   ...   207   208   209   210   211   212   213   214   ...   288




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin