You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of instantiating the Value Objects directly from the controller, we should instantiate a DTO such as SignUpUserRequest and pass it to the Application Service.
The Application Services intended for querying data, we should return also a DTO such as UserResponse.
Why
This way we:
Avoid coupling our entry points to the internal details on how we model out our domain (UserId value objects and so on).
Leave the code on the Hexagonal Architecture approach closer to what we'll do while evolving to an architecture applying CQRS concepts. We will only need to:
Replace the XxxRequest by their corresponding XxxCommand,
Send the commands to the Command Bus instead of directly calling the Application Service
Implement the Command Handler in order to extract each one of the scalar values from the Command, convert them to Value Object instances, and call to the Application Service
Modify the Application Service in order to directly receive the Value Objects instead of the XxxRequest
The text was updated successfully, but these errors were encountered:
What
Instead of instantiating the Value Objects directly from the controller, we should instantiate a DTO such as
SignUpUserRequest
and pass it to the Application Service.The Application Services intended for querying data, we should return also a DTO such as
UserResponse
.Why
This way we:
UserId
value objects and so on).XxxRequest
by their correspondingXxxCommand
,XxxRequest
The text was updated successfully, but these errors were encountered: