DTO (Data Transfer Object) Pattern is used to transfer the data between the client and server.
Data Transfer Object Design Pattern is a frequently used design pattern. It is basically used to pass data with multiple attributes in one shot from client to server, to avoid multiple calls to a remote server.
Another advantage of using DTOs on RESTful APIs written in Java (and on Spring Boot), is that they can help to hide implementation details of domain objects (JPA entities). Exposing entities through endpoints can become a security issue if we do not carefully handle what properties can be changed through what operations.
![](https://i.ytimg.com/vi/MAIkC9KctVw/maxresdefault.jpg)