Answer the question
In order to leave comments, you need to log in
What is the best way to organize communication between several Entities, storages and Domain Model?
Hello.
In the process of implementing DDD, it stalled on the following:
The application stores part of the data in the database, and implements part of the data through the API to a remote server. Accordingly, it was decided to create entities based on the data that correspond to the tables in the database - this is for ORM mapping, and others to correlate with the data necessary to work with the API. It was decided to combine the obtained entities by type into the corresponding Domain Models that would meet the set business requirements.
Those. for example:
class PostEntity{
private $id;
private $externalId;
private $userId;
private $date;
}
class ExternalPostEntity{
private $id;
private $postCode;
private $author;
private $title;
private $description;
}
class PostModel{
private /*PostID*/ $postId;
private /*User*/ $user;
private /*Date*/ $date;
private $title;
private $description;
private $code;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question