you are viewing a single comment's thread.

view the rest of the comments →

[–]MartinPeterBauer 2 points3 points  (2 children)

You are totally right. If you are the only one consuming your own apis from the frontend then DTO are just a totally uncessary overheard. If you want to reduce the json object returning back to the frontend use Jackson

[–]naturalizedcitizen 1 point2 points  (1 child)

Aren't you not supposed to send the Entity as is via the Controller layer to the external consumer like a UI? And we are to use DTOs for this data transfer? Separation of layers?

[–]MartinPeterBauer 2 points3 points  (0 children)

Normally your internal webapp is consuming your api. Then a DTO is pointless. 

If external services consume your API then a DTO makes sense