Separate the domain model and persistence layer #8757
Unanswered
mohammadhsn
asked this question in
Support Questions
Replies: 1 comment
-
@mohammadhsn that is not going to be possible 100%, due to other concerns such as lazy loading. but |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a design-related question, As I know about DDD and some sources I read, most people indicate separations between domain and persistence (or infrastructure in general). Most people use Doctrine ORM when they consider the DDD approach in PHP, domain models (or Entities) are a part of domain, so they have no idea about persistence.
Let's imagine we have an
Author
domain model that publishes posts, I thought below code:I fact, what I want is I could use the
Post
andAuthor
classes as domain models and also as doctrine entities.The problem is doctrine forces me to use
ArrayCollection
instead ofarray
so the domain has to know about persistence. I'm looking for a design solution that separates all domain model concerns from doctrine concerns.Beta Was this translation helpful? Give feedback.
All reactions