DEV Community

CQRS with Symfony Messenger

Adrian Garay on August 22, 2022

Ve la versión en español CQRS con Symfony Messenger (Español) Adrian Garay ・ Aug 22 ・ 8 min read ...
Collapse
 
lobodol profile image
lobodol • Edited

Hi, thanks for your post, that's interesting.
However, you didn't mention the validation of your models. Where should it be done? In the Command objects of the application layer or directly in the models of the domain layer?

Collapse
 
adgaray profile image
Adrian Garay

Hi, sorry for the late response, I think validations of types are going to happen before dispatching the command, taking the request parameters and cast it to the expected types. Validations like the max/min length for the email is going to be placed on the VO EmailAddress.php

Collapse
 
vuylov profile image
Dmitriy

Hi, what about exist entity validation?

Thread Thread
 
adgaray profile image
Adrian Garay

Could you elaborate more?