DDD - Persistence Model and Domain Model

后端 未结 3 799
野性不改
野性不改 2020-12-12 10:26

I am trying to learn domain-driven design (DDD), and I think I got the basic idea. But there is something confusing me.

In DDD, are the persistence model and domain

3条回答
  •  猫巷女王i
    2020-12-12 10:38

    In DDD, are persistence model and domain model different things?

    In DDD you have the domain model and the repository. Thats it. If inside of the repository you will persist your domain model directly OR you convert it to a persistence model before persisting is up to you! It's a matter of design, your design. It's an implementation detail of your repository and doesn't matter for the domain itself.

    As other aswers have pointed each option has its Pros and Cons. Take a look at this answer where I detail some of them.

提交回复
热议问题