Data Transfer Object (DTO) is one of the design patterns used to transfer data between application subsystems. A Data Transfer Object, unlike a business object or data access object, must not contain any behavior.
In Java
Enterprise JavaBeans DTO is used for serialization .
Entity beans represent objects that are in persistent storage, for example, in a database . On the one hand, it is very convenient, because the client program should not take care of connecting to the database directly. On the other hand, every change to an entity bean can trigger remote access methods, which increases the load on the network and reduces the speed of the program. The Sun Java Center recommended to isolate all the data in a separate object and solve this object in the entity bean using one method.
In version EJB 3.0, the data record model was changed, this problem was resolved, and the need for DTO disappeared.
Note
Do not confuse DTO with Value Object - these are different patterns. The confusion is caused by the fact that in the early J2EE literature the term "Value Object" was used to describe the DTO, but was later replaced with the "Transfer Object".