liveBook · Manning

Data transfer object

Also called DTOs

A data transfer object is a data-carrying structure that conveys selected information between software components or across boundaries without encapsulating substantial domain behavior.

How 10 Manning books explain it

Building Web APIs with ASP.NET Core

A data-transfer object is an object that packages data for transfer between software components or across an interface.

How it is used
Packages board-game API request and response data for exchange as JSON with clients.
How deep it goes
Builds generic response and endpoint-specific input classes, then follows their use through controller actions and validation.
Examples
Uses a linked board-game response, a board-game update request, and account registration and login DTOs.
What you can do after
Build it from scratch for ASP.NET Core endpoints that accept selected inputs or return typed data with descriptive links.

Read how Building Web APIs with ASP.NET Core explains data transfer object →

Clean Applications with Hexagonal Architecture

A data transfer object is a data-carrying type designed to convey structured information between software components without encapsulating domain behavior.

How it is used
Uses DTOs to carry consumer-shaped data across output ports and return query results without exposing domain entities.
How deep it goes
Works through repository conventions and mapping strategies, from outbound-only mapping to separate models at every boundary.
Examples
Shows Java record DTOs for notifications and articles, plus a publication-readiness query mapped from domain assessment to HTTP response.
What you can do after
Evaluate mapping strategies for API isolation, persistence separation, and the maintenance cost of additional mappers.

Read how Clean Applications with Hexagonal Architecture explains data transfer object →

Microservices Patterns, Second Edition

A data transfer object is a data structure that carries structured data across an interface without exposing domain implementation objects.

How it is used
Models API-client messages so outbound payloads match service formats and inbound payloads become application-usable domain objects.
How deep it goes
Compares untyped maps, handwritten classes, code generation, and service-provided libraries against effort, correctness, type safety, and coupling.
Examples
Uses requests, commands, events, responses, replies, consumed events, and map-based message models as examples.
What you can do after
Build it from scratch by selecting handwritten, generated, or untyped DTOs for an API client's message payloads.

Read how Microservices Patterns, Second Edition explains data transfer object →

Secure APIs

A data transfer object is a data structure used to carry structured data between software layers or processes without encapsulating domain behavior.

How it is used
Uses DTOs as a secure implementation pattern for transferring limited data across API, business, database, and other application layers.
How deep it goes
Defines DTOs and their security purpose, but stops short of showing DTO code or a construction procedure.
Examples
Uses API, business, and database layers as the concrete transfer path, with incoming and outgoing payloads as validation boundaries.
What you can do after
Apply DTOs to restrict transferred fields, then validate payloads and test each application layer.

Read how Secure APIs explains data transfer object →

Spring Start Here, Second Edition

A data transfer object is an object that carries structured data between software applications or application boundaries.

How it is used
Models data exchanged between a REST endpoint and another application, as either a request body or a response.
How deep it goes
Defines DTOs through request and response examples and shows JSON formatting, while deferring JSON basics to an appendix.
Examples
Uses Country response objects and a TransferRequest body carrying account IDs and an amount.
What you can do after
Apply DTOs in Spring REST controllers by returning response objects or accepting request-body objects.

Read how Spring Start Here, Second Edition explains data transfer object →

.NET MAUI in Action

A data transfer object is a data structure that carries serialized data between application or service boundaries without encapsulating business behavior.

How it is used
Shares consistent data shapes across application, Web API, and .NET MAUI client projects.
How deep it goes
Defines DTO behavior and contrasts it with ViewModel functionality, but does not detail serialization or transport protocols.
Examples
Uses ProductDto, StockCountDto, InventoryItemDto, User, and aggregated leaderboard data as examples.
What you can do after
Apply it via shared projects to reuse data structures and distinguish data-only DTOs from functional ViewModels.

Read how .NET MAUI in Action explains data transfer object →

.NET in Action, Second Edition

A data transfer object is an object that defines the data communicated across a boundary without necessarily exposing the structure of the underlying domain or persistence model.

How it is used
Structures data crossing application boundaries, especially between web-facing operations and persistence code.
How deep it goes
Defines DTO purpose and implements separate C# records for creation and update, without detailing serialization or validation.
Examples
Uses NewCustomerDto and UpdateCustomerDto in a customer repository called by a CSV importer.
What you can do after
Build it from scratch by defining operation-specific records and passing them through explicit repository methods.

Read how .NET in Action, Second Edition explains data transfer object →

Data-Oriented Programming in Java

A data transfer object is a data-carrying structure used to exchange information between software components without encapsulating domain behavior.

How it is used
Bridges a data-oriented domain model with legacy entities and persistence machinery at controlled exchange points.
How deep it goes
Demonstrates explicit field-by-field translation and defers replacing legacy repositories or entities.
Examples
Uses late-fee-to-invoice conversion, repository saving, and modern-to-legacy serialization as concrete examples.
What you can do after
Apply it by translating domain data into legacy structures while preserving freedom to evolve the domain model.

Read how Data-Oriented Programming in Java explains data transfer object →

Building Distributed Applications that Work

A data transfer object is a data-only structure that carries selected values across application or service boundaries.

How it is used
Carries product data from an API to a UI without exposing the database entity as the UI’s data type.
How deep it goes
Defines the DTO’s boundary role and shows a C# record and consuming client, but does not detail entity-to-DTO conversion.
Examples
Uses a ProductDto record, a /products HTTP request, and a home-page product table.
What you can do after
Build it from scratch as a C# product record, then use it to receive and display API data.

Read how Building Distributed Applications that Work explains data transfer object →

F# in Action: A Revised Edition of Get Programming with F#

A data transfer object is an object that carries data between software components without encapsulating domain behavior.

How it is used
Separates JSON-facing data from rich domain behavior during deserialization and supports F#’s data-first design.
How deep it goes
Defines simple records, demonstrates raw-to-domain validation, and stops short of embedding domain logic in converters.
Examples
Uses a guitar inventory with RawGuitar fields, JSON input, and tryAsFullGuitar mapping.
What you can do after
Build it from scratch by defining a JSON-shaped record, deserializing into it, and mapping validated values into the domain.

Read how F# in Action: A Revised Edition of Get Programming with F# explains data transfer object →

Also covered in

What to know first

Related concepts

Questions about data transfer object

What is data transfer object?

A data transfer object is a data-carrying structure that conveys selected information between software components or across boundaries without encapsulating substantial domain behavior.

Which Manning books explain data transfer object?

Building Web APIs with ASP.NET Core, Clean Applications with Hexagonal Architecture, Microservices Patterns, Second Edition, Secure APIs, Spring Start Here, Second Edition, .NET MAUI in Action, .NET in Action, Second Edition, Data-Oriented Programming in Java and 2 more.

What should I know before learning data transfer object?

Manning books that teach data transfer object usually introduce entity, JSON, record and serialization first.

What is the difference between data transfer object and view model?

A data transfer object is a data-carrying structure that conveys selected information between software components or across boundaries without encapsulating substantial domain behavior. A view model is a data structure that supplies a user-interface view with information formatted for display.

What kinds of data transfer object are there?

Kinds of data transfer object include command.

What is data transfer object also called?

Data transfer object is also called DTOs.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.