encyclopegia.org

Data transfer object

In the field of programming a data transfer object (DTO ) is an object that carries data between processes. The motivation for its use is that communication between processes is usually done resorting to remote interfaces (e.g., web services), where each call is an expensive operation. Because the majority of the cost of each call is related to the round-trip time between the client and the server, one way of reducing the number of calls is to use an object (the DTO) that aggregates the data that would have been transferred by the several calls, but that is served by one call only. The difference between data transfer objects and business objects or data access objects is that a DTO does not have any behavior except for storage, retrieval, serialization and deserialization of its own data (mutators, accessors, serializers and parsers). In other words, DTOs are simple objects that should not contain any business logic but may contain serialization and deserialization mechanisms for transferring data over the wire. This pattern is often incorrectly used outside of remote interfaces. This has triggered a response from its author where he reiterates that the whole purpose of DTOs is to shift data in expensive remote calls. In some languages, these can usually be represented as records (or structs).

In the field of programming a data transfer object (DTO ) is an object that carries data between processes. The motivation for its use is that communication between processes is usually done resorting to remote interfaces (e.g., web services), where each call is an expensive operation. Because the majority of the cost of each call is related to the round-trip time between the client and the server, one way of reducing the number of calls is to use an object (the DTO) that aggregates the data that would have been transferred by the several calls, but that is served by one call only. The difference between data transfer objects and business objects or data access objects is that a DTO does not have any behavior except for storage, retrieval, serialization and deserialization of its own data (mutators, accessors, serializers and parsers). In other words, DTOs are simple objects that should not contain any business logic but may contain serialization and deserialization mechanisms for transferring data over the wire. This pattern is often incorrectly used outside of remote interfaces. This has triggered a response from its author where he reiterates that the whole purpose of DTOs is to shift data in expensive remote calls. In some languages, these can usually be represented as records (or structs). ==Terminology== A value object is not a DTO. The two terms have been conflated by Sun/Java community in the past. ==Example== The following is an example of a DTO, using a Java record. import java.io.FileInputStream; import java.io.IOException; import java.util.Properties; import jakarta.validation.constraints.Email; import jakarta.validation.constraints.NotBlank; record UserResponseDTO( Long id, @NotBlank(message = "Name cannot be empty") String name, @Email(message = "Invalid email format") String email ) {} try (FileInputStream f = new FileInputStream("config.properties") { Properties prop = new Properties(); prop.load(f); UserResponseDTO user = new UserResponseDTO(1L, prop.getProperty("user.name"), prop.getProperty("user.email")); System.out.println(user.name()); } catch (IOException e) { System.err.println("Error loading properties file: " + e.getMessage()); } ==References== ==External links== Summary from Fowler's book Data Transfer Object - Microsoft MSDN Library GeDA - generic dto assembler is an open source Java framework for enterprise level solutions Local DTO

References

No reference rows published for this article.

Cite this article

MLA

"Data transfer object." encyclopegia.org, 2026, https://encyclopegia.org/wiki/data-transfer-object. Accessed 24 November 2026.

Chicago

"Data transfer object." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/data-transfer-object.

APA

encyclopegia.org. (2026). Data transfer object. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/data-transfer-object

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Digital Object Identifier

article · references available

Electronic Object Identifier

article · references available

trans-Neptunian object

stub · references available

Messier object

stub · references available

domain name transfer

stub · references available

horizontal gene transfer

stub · references available

one cent transfer

stub · references available

digital data

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1372904577 · 0.5 · snapshot enwiki-001372904577

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.