Edition 0 Updated to asp. Net core 0


Tackle Business Complexity in a Microservice with DDD and CQRS Patterns .............. 182



Yüklə 11,82 Mb.
Pdf görüntüsü
səhifə9/288
tarix12.07.2023
ölçüsü11,82 Mb.
#136458
1   ...   5   6   7   8   9   10   11   12   ...   288
NET-Microservices-Architecture-for-Containerized-NET-Applications

Tackle Business Complexity in a Microservice with DDD and CQRS Patterns .............. 182
 
Apply simplified CQRS and DDD patterns in a microservice............................................................................. 184
 
Additional resources ..................................................................................................................................................... 186
 
Apply CQRS and CQS approaches in a DDD microservice in eShopOnContainers ................................. 186
 
CQRS and DDD patterns are not top-level architectures ............................................................................... 187
 
Implement reads/queries in a CQRS microservice ................................................................................................ 188
 
Use ViewModels specifically made for client apps, independent from domain model constraints
 ............................................................................................................................................................................................... 189
 
Use Dapper as a micro ORM to perform queries .............................................................................................. 189
 
Dynamic versus static ViewModels ......................................................................................................................... 190
 
Additional resources ..................................................................................................................................................... 193
 
Design a DDD-oriented microservice ......................................................................................................................... 194
 
Keep the microservice context boundaries relatively small .......................................................................... 194
 
Layers in DDD microservices ..................................................................................................................................... 195
 


vi 
Contents
Design a microservice domain model ........................................................................................................................ 199
 
The Domain Entity pattern ......................................................................................................................................... 199
 
Implement a microservice domain model with .NET ............................................................................................ 204
 
Domain model structure in a custom .NET Standard Library ....................................................................... 204
 
Structure aggregates in a custom .NET Standard library ............................................................................... 205
 
Implement domain entities as POCO classes ..................................................................................................... 206
 
Encapsulate data in the Domain Entities .............................................................................................................. 207
 
Seedwork (reusable base classes and interfaces for your domain model) .................................................. 210
 
The custom Entity base class ..................................................................................................................................... 211
 
Repository contracts (interfaces) in the domain model layer ...................................................................... 212
 
Additional resources ..................................................................................................................................................... 213
 
Implement value objects .................................................................................................................................................. 213
 
Important characteristics of value objects ........................................................................................................... 214
 
Value object implementation in C# ........................................................................................................................ 215
 
How to persist value objects in the database with EF Core 2.0 and later ................................................ 217
 
Persist value objects as owned entity types in EF Core 2.0 and later ........................................................ 218
 
Additional resources ..................................................................................................................................................... 221
 
Use enumeration classes instead of enum types ................................................................................................... 222
 
Implement an Enumeration base class .................................................................................................................. 222
 
Additional resources ..................................................................................................................................................... 223
 
Design validations in the domain model layer ....................................................................................................... 223
 
Implement validations in the domain model layer ........................................................................................... 224
 
Additional resources ..................................................................................................................................................... 226
 
Client-side validation (validation in the presentation layers) ............................................................................ 226
 
Additional resources ..................................................................................................................................................... 227
 
Domain events: Design and implementation .......................................................................................................... 228
 
What is a domain event? ............................................................................................................................................. 228
 
Domain events versus integration events ............................................................................................................ 229
 
Domain events as a preferred way to trigger side effects across multiple aggregates within the 
same domain ................................................................................................................................................................... 229
 
Implement domain events .......................................................................................................................................... 231
 
Conclusions on domain events ................................................................................................................................. 238
 


vii 
Contents
Additional resources ..................................................................................................................................................... 239
 
Design the infrastructure persistence layer .............................................................................................................. 239
 
The Repository pattern ................................................................................................................................................ 240
 
Additional resources ..................................................................................................................................................... 244
 
Implement the infrastructure persistence layer with Entity Framework Core ............................................ 244
 
Introduction to Entity Framework Core ................................................................................................................. 245
 
Infrastructure in Entity Framework Core from a DDD perspective ............................................................. 245
 
Implement custom repositories with Entity Framework Core ...................................................................... 247
 
EF DbContext and IUnitOfWork instance lifetime in your IoC container ................................................. 249
 
The repository instance lifetime in your IoC container ................................................................................... 250
 
Table mapping ................................................................................................................................................................ 251
 
Implement the Query Specification pattern ........................................................................................................ 254
 
Use NoSQL databases as a persistence infrastructure ......................................................................................... 256
 
Introduction to Azure Cosmos DB and the native Cosmos DB API ........................................................... 257
 
Implement .NET code targeting MongoDB and Azure Cosmos DB .......................................................... 259
 
Design the microservice application layer and Web API .................................................................................... 267
 
Use SOLID principles and Dependency Injection .............................................................................................. 267
 
Implement the microservice application layer using the Web API ................................................................. 268
 
Use Dependency Injection to inject infrastructure objects into your application layer ..................... 268
 
Implement the Command and Command Handler patterns ....................................................................... 272
 
The Command process pipeline: how to trigger a command handler ..................................................... 279
 
Implement the command process pipeline with a mediator pattern (MediatR) .................................. 282
 
Apply cross-cutting concerns when processing commands with the Behaviors in MediatR .......... 288
 

Yüklə 11,82 Mb.

Dostları ilə paylaş:
1   ...   5   6   7   8   9   10   11   12   ...   288




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

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin