![domain driven design mvc domain driven design mvc](https://slidetodoc.com/presentation_image_h/1bce11080742ca18e73069411419462d/image-16.jpg)
Imagine that you change the presentation layer from React to Angular, your domain, services and infrastructure layers shouldn't be changed due to this.Entity framework (ef) is an object relational mapper (orm) that enables developers to work with relational data using domain-specific objects. Always develop thinking the presentation layer is independent of the other layers.Packages used for presentation only shouldn't be in the domain project This is valid for packages used in the Application Services and Infrastructure layers.
#Domain driven design mvc update#
![domain driven design mvc domain driven design mvc](https://image.slidesharecdn.com/usingmvvminsidemvcindomaindrivendesign-181202090603/85/using-mvvm-inside-mvc-in-domain-driven-design-2-320.jpg)
![domain driven design mvc domain driven design mvc](https://i.stack.imgur.com/0nJXP.png)
TDD or Unit Tests (add UnitTest project and use only.JWT Authentication (configure Bearer or other, policies, etc.).Monoliths or Microservices (one solution for each service).□ This solution architecture is suitable for This diagram provides an overview of how this solution works at run time execution diagram: The important thing is that the solution layers (Services, Infrastructure and Domain) remain independent to receive another presentation layer. You can replace the Web.Api with Web Application or other projects. AddScoped() □ Change the solution your way Basically, in the IOC project, it is necessary to insert All in the references of the other projects. csproj of the IOC project (it makes the dependency injection). To protect the projects with the concrete codes (Application Services, Infrastructure), we changed the. The same happens if you insert a UnitTest project, you only need the Domain and Ioc project references. In this way, the presentation layers only know the domain (which contains only interfaces, isolating the concrete codes). The idea is to isolate the Services and Infrastructure projects. Note that the Domain layer has no reference to any project.
![domain driven design mvc domain driven design mvc](https://www.codurance.com/hubfs/Imported_Blog_Media/dddlayered.png)
The main difference of this solution is to protect the concrete codes (Application Services, Infrastructure) and to force the presentation layers (or UnitTest projects) to use only the interfaces and entities. This DDD project is totally directed to the domain.
#Domain driven design mvc how to#
The goal is to show how to build a solution in DDD architecture, the codes are just examples of use. NET 5 with simple WebAPI example and separated projects.