Data Transfer Object

Data transfer object (DTO), is a design pattern used to transfer data between software application subsystems. DTOs are often used in conjunction with data access objects to retrieve data from a database.

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 and retrieval of its own data (accessors and mutators). DTOs are simple objects that should not contain any business logic that would require testing.

In a traditional EJB (Enterprise JavaBeans) architecture, DTOs serve dual purposes: first, they work around the problem that entity beans pre-ejb 3.0 are not serializable; second, they implicitly define an assembly phase where all data to be used by the view are fetched and marshalled into the DTOs before returning control to the presentation tier. A third reason of using DTOs could be that certain layers of the application should not be able to access the underlying data access objects, and hence change the data.

Famous quotes containing the words data, transfer and/or object:

    This city is neither a jungle nor the moon.... In long shot: a cosmic smudge, a conglomerate of bleeding energies. Close up, it is a fairly legible printed circuit, a transistorized labyrinth of beastly tracks, a data bank for asthmatic voice-prints.
    Susan Sontag (b. 1933)

    No sociologist ... should think himself too good, even in his old age, to make tens of thousands of quite trivial computations in his head and perhaps for months at a time. One cannot with impunity try to transfer this task entirely to mechanical assistants if one wishes to figure something, even though the final result is often small indeed.
    Max Weber (1864–1920)

    I wish you would not let him plunge into a ôvortex of
    Dissipation.ö I do not object to the Thing, but I cannot bear the
    expression; it is such thorough novel slang—and so old, that I
    dare say Adam met with it in the first novel he opened.
    Jane Austen (1775–1817)