~ TL; DR: I am implementing a CQRS + DDD solution for one of my larger projects, and I am wondering if there is any real reason why my command handlers cannot directly send command objects to my aggregates, in a small number of cases when the command object is data rich? I cannot find any specific reason why this would be some kind of anti-pattern, and I can not find any comments that describe this type of design in detail.
Reference Information. I already implemented CQRS systems, and I applied DDD applications, but never CQRS + DDD in the correct application based on Eric Evans style. Therefore, I ask because I do not want to abuse my Aggregates and harm my application in the long run.
An example of my command object that has enough data bits is a registration command that accepts 8 + fields (first name, last name, preferred name, dob, name, username, password, department, etc.). This is very inconvenient, creating my aggregate method, which has 8 parameters, and an alternative solution to using some kind of dto and having my dto command map handler — either automatically using automapper or inline — seems unnecessary and adding an abstraction without a value.
I can also see future use cases where teams may be rich in data (this will not be a large percentage of teams, but there will still be few of them), so I would like to get this seemingly trivial aspect right from the beginning.
domain-driven-design cqrs
Aaronhs
source share