-1

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
    Perform all the business logics and transformation in service class. – Alien Sep 10 '22 at 02:47
  • Does this answer your question? [Which layer should be used for conversion to DTO from Domain Object](https://stackoverflow.com/questions/47822938/which-layer-should-be-used-for-conversion-to-dto-from-domain-object) – Alien Sep 10 '22 at 02:50

1 Answers1

0

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

mamJavad
  • 49
  • 8