What is the correct way to register one to many with DDD

1

I have studied DDD and mounted a similar architecture to the books and examples I have read.

So far, when I'm going to do a crud, when I write I run something like this:

  • UI : The display layer fills an object with the screen data (DTO, ViewModel, command) and calls the interface layer

  • Interface : The interface layer (facade) transforms this object with screen information into a domain model object and calls the application layer
  • p>
  • Application : The application layer receives this object that is part of the domain layer and calls an infra-repository
  • Infra : The underlying layer (repository) persists the object in the database.

1st question: Is this architecture legal or outrageously wrong?

Assuming that this division is reasonably acceptable, my cruel question is about the crud of a domain model that has children (One to many), example:

A Pedido signup screen with multiple PedidoItem request items that must be registered at the same time.

2nd Question

How do I mount this object ?? I populate a viewModel up there on the UI layer ( RequestModel and list) and only when the request data is all mounted do I send this face down ) to be transformed into a domain object ( Request ) ??

OR

I save the instance of the domain object ( Request ) in the application layer and insert item a item (via RequestViewModel ) on the same layer?     

asked by anonymous 29.11.2016 / 16:04

0 answers