Data transfer object
   HOME

TheInfoList



OR:

In the field of programming a data transfer object (DTOMSDN (2010). Data Transfer Object. Microsoft
MSDN Microsoft Developer Network (MSDN) was the division of Microsoft responsible for managing the firm's relationship with developers and testers, such as hardware developers interested in the operating system (OS), and software developers developing ...
Library. Retrieved from https://msdn.microsoft.com/en-us/library/ms978717.aspx.
Fowler, Martin (2010). Data Transfer Object. Patterns of Enterprise Application Architecture. Retrieved from http://martinfowler.com/eaaCatalog/dataTransferObject.html.) 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 object A business object is an entity within a multi-tiered software application that works in conjunction with the data access and business logic layers to transport data. For example, a "Manager" would be a ''business object'' where its attributes ...
s 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,
parsers Parsing, syntax analysis, or syntactic analysis is the process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar. The term ''parsing'' comes from L ...
and serializers). 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 A pattern is a regularity in the world, in human-made design, or in abstract ideas. As such, the elements of a pattern repeat in a predictable manner. A geometric pattern is a kind of pattern formed of geometric shapes and typically repeated li ...
is often incorrectly used outside of remote interfaces. This has triggered a response from its authorLocalDTO. Retrieved from http://martinfowler.com/bliki/LocalDTO.html. where he reiterates that the whole purpose of DTOs is to shift data in expensive remote calls.


Terminology

A
value object In computer science, a value object is a small object that represents a ''simple'' entity whose equality is not based on identity: i.e. two value objects are ''equal'' when they ''have'' the same ''value'', not necessarily being the ''same object'' ...
is not a DTO. The two terms have been conflated by Sun/Java community in the past.


References


External links


Summary from Fowler's bookData Transfer Object - Microsoft MSDN LibraryGeDA - generic dto assembler is an open source Java framework for enterprise level solutions
Architectural pattern (computer science) Concurrent computing Software design patterns {{compu-prog-stub