Domain Model Persistence
We then performed some simple refactors to encapsulate domain logic within our classes.
Domain model persistence. Building a domain model an introduction to persistence agnosticism. The persistence model models what and how data is stored it models storage structure. If you choose to keep separate domains however not only your domain model will be more expressive but your persistence will benefit from it too.
This is where ood fits into your code and where you code business logic. Persistence model pm for the sake of this article i am going to call the set of orm entities in a project the persistence model of that project. The domain should not depend on anything especially not on a persistence implementation detail like ef or nh.
The problem here is that the application s database shouldn t be treated separately from the regular code base and must evolve with that code base hand by hand. However such situation is a sign of a bigger problem. Introduction of a persistence model is inevitable in this case if you want to have a more or less isolated domain model.
Domain modelling and persistence with ef core part 2. Domain model dm it is your domain entities. One option would be to give the domain model a way to do persistence itself.
The domain is the reason the application exists and everything gravitates around it. This article is a part of a series about the concept of extensibility that virtocommerce platform provides and with which you should be guided when building your custom projects based on the platform. The domain model and persistence layer extension.
Postload hooks or force hibernate to use accesstype property but these are all tricks that are only needed for the persistence framework and will not add any other value. Using a single model if your database schema is very simple and you dont have many invariants to adhere is also fine. You could for example inject an ifoorepository via constructor injection and have that resolved by an ioc container to ensure you don t create a dependency on it à la onion architecture.