Where should DTO conversion be done in MVC?

Viewed 41

Where should DTO conversion be done in MVC?

I am using JPA. Receive DTO as parameter from Controller.

At this time, is it necessary to convert it in the controller and pass it to the service?

Or, I wonder if the service receives the DTO and converts it.

1 Answers

I use DTO in service layer . because service must contain business logic . controller is just a middleware between processing data and show the result to user so It seems reasonable to map DTO to your entity in service

Related