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:

    Mental health data from the 1950’s on middle-aged women showed them to be a particularly distressed group, vulnerable to depression and feelings of uselessness. This isn’t surprising. If society tells you that your main role is to be attractive to men and you are getting crow’s feet, and to be a mother to children and yours are leaving home, no wonder you are distressed.
    Grace Baruch (20th century)

    I have proceeded ... to prevent the lapse from ... the point of blending between wakefulness and sleep.... Not ... that I can render the point more than a point—but that I can startle myself ... into wakefulness—and thus transfer the point ... into the realm of Memory—convey its impressions,... to a situation where ... I can survey them with the eye of analysis.
    Edgar Allan Poe (1809–1849)

    The Dada object reflected an ironic posture before the consecrated forms of art. The surrealist object differs significantly in this respect. It stands for a mysterious relationship with the outer world established by man’s sensibility in a way that involves concrete forms in projecting the artist’s inner model.
    —J.H. Matthews. “Object Lessons,” The Imagery of Surrealism, Syracuse University Press (1977)