E
E
Eugene Sherman2018-04-14 21:52:29
PHP
Eugene Sherman, 2018-04-14 21:52:29

How to properly process incoming data?

Hello!
There was a question on DDD, namely, on the processing of incoming data from the external environment.
As I understand it, the main task of a mapper is to convert data between two environments. It is mostly used to convert data from the database into terms of objects in our model.
But what to do with the incoming data. It seems to me that it would also be convenient to pass them through the mapper to convert them into the model language?
Am I understanding the sequence correctly? Incoming data → view controller → validation form → incoming data mapper → model → storage → database mapper

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Antonio Solo, 2018-04-15
@solotony

1) use a framework that already does this
2) write the framework yourself.
What is your task?

E
Eugene Sherman, 2018-04-15
@freehostua

The task is to understand how the process of processing incoming data should take place before they enter the database.

D
ddd329, 2018-09-19
@ddd329

When your data reaches the ApplicationLayer, then the service of this level should get the aggregate from the repository, and perform actions on this aggregate based on the incoming data. For example, if the user's last name has been edited, then:
1. var user = userRepository.GetById(777);
2. user.LastName = inputData.LastName;
3. userRepository.Save(user);
In that spirit...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question