Why does CommandHandler, resolveHandlerForAggregateRoot look at constructor parameters? #335
Unanswered
rikzwarthoff
asked this question in
Ideas
Replies: 2 comments
-
@brendt Do you want to take a look at this one? |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is by design.
In summary: it's by design to prevent developers from doing too much in their command classes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The CommandHandler, resolveHandlerForAggregateRoot function resolves the $uuidField by looking at which constructor parameter has the AggregateUuid attribute. In my opinion it would make more sense to look at class properties which have the attribute as it also tries to access a class property.
This would allow for some different constructor parameters and maybe some logic in the constructor. For example setting the uuid by a given model in the constructor. It would also allow for extending of class, say want you put the AggregateUuid attribute in the parent class. Now that's not possible.
.
Beta Was this translation helpful? Give feedback.
All reactions