19 August, 2020
Roel van Lisdonk
1 category
# Introduction From the blog post at https://medium.com/@jpdeffo/domain-driven-design-ddd-in-microservice-architecture-for-nutshell-19c7c579009a and code at https://github.com/Defcoq/DDD I have learned how to architect a .NET Core project by using DDD principals. The main thing you will have to realize, when you come from a layered architecture, is that the logical flow of data, does not correspond with the project references in Visual Studio. # Logical dataflow Controllers (MyApp.Web.csproj) => Domain Services (MyApp.Domain.csproj) => Persistence services (MyApp.Persistence.csproj) Controller data flows – On a HTTP GET a .NET controller will, OPTIONAL – Receive primitive types or data transfer objects (DTO) from the client OPTIONAL – Map data transfer objects (DTO) to domain models Call domain service(s) by using DI Receive domain models Map domain models to data transfer objects (DTO) Return data transfer objects (DTO) to the client. – On a HTTP POST a .NET controller will, OPTIONAL – Receive primitive types or data transfer objects (DTO) from the client OPTIONAL – Map data transfer objects (DTO) to domain models Call domain service(s) by using DI OPTIONAL – Receive domain models OPTIONAL – Map domain models to data transfer objects (DTO) OPTIONAL – Return data transfer objects (DTO) to the client. Domain Service data flows – Receive primitive types or domain models – Act on domain models – OPTIONAL – Call persistence services with primitive types or domain models, by using DI – OPTIONAL – Receive primitive types or domain models