-
Notifications
You must be signed in to change notification settings - Fork 299
Open
Labels
Milestone
Description
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:
- 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 correspondingXxxCommand
, - 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
- Replace the