Domain Driven Design Repository Example C
This is part of the domain driven design w typescript node js course.
Domain driven design repository example c. In domain driven design there s a correct tool for every possible thing that needs to happen in the development of an object modeled system. On my article creating domain driven design entity classes with entity framework core ardalis commented that your entities all are tightly coupled to ef core. It means each domain class should have a direct relation to what it represents in the business domain. You need to identify what are the items objects you need to accomplish the desired functionalities of your application.
For example in khorikov s solution he puts cqrs commands into the domain layer and the microsoft e book does basically the same thing with repository interfaces. The one caveat is that he has multiple repositories with no aggregate roots so it s far from a textbook example. Domain driven design purely based on these assumptions to map the business requirement into domain model. In domain driven design your objective is to create a model of the domain.
Check it out if you liked this post. Also from the domain driven design with typescript series. In my architectural template cqrs commands and queries and repository interfaces if you choose to use them never go into the domain layer because they. Hey repository give me that bsuinessentity with this id.
Also earlier implementations of the repository returned iqueryable so there were no domain boundaries on the repository which is the source of most of the noise made about his design. Please do note that this is my interpretation of domain driven design i e. Please use this for theoretical educational purposes only. The repository design pattern in c mediates between the domain and the data mapping layers using a collection like interface for accessing the domain objects.
I don t agree with them. Then i did a podcast with bryan hogan where we discussed domain driven design ddd and he goes further than my crud only create read update and delete approach he says that the entity classes. Simply put the domain just says. You need to identify the relationships among different objects and how they interact among themselves.
To supplement blog articles on ddd see below and create easy to follow domain driven design repository that makes sense if it still makes no sense then please do let me know. Domain driven design is all about how you model your domain. That s because the purpose of the repository is to decouple the domain from the persistence details.