0
Following the Patterns defined in the DDD I have my non-anemic domain class with data and behaviors and one of them is my aggregator, so far everything ok.
My question is when I have a lot of data that was passed by a user to create or update that entity my method gets many parameters.
One way to solve this would be to encapsulate these parameters in a class, but this class to be used in my domain would have to be part of it, but it gets weird to create this class when it doesn’t represent a value object, entity or anything similar being a simple DTO.
And I also don’t know if it’s right that I create one of these objects, as a value object outside of my aggregator, as far as I understand it’s his responsibility to create all the "children" that make up the same.
So is there any way to pass this list of parameters in a better way?
In my view it makes no sense to create a DTO in my domain, summarizing my question would be whether there is an alternative in I create an Object value that belongs to an Aggregate outside of it to pass as parameter to my domain.
– Vinícius Dias Saraiva
https://docs.microsoft.com/pt-br/dotnet/architecture/microservice-ddd-cqrs-patterns/net-core-microservice-domain-model Here’s an example where he adds a product to the cart but passes only the primitios leaving creation to the domain class, but in my case I have many attributes to pass, like a map and can’t pass without creating an object
– Vinícius Dias Saraiva