Skip to main content
1 of 2
Robert Harvey
  • 200.7k
  • 55
  • 470
  • 683

Unless your system is based strictly on CRUD operations, your DTO's are too granular. Try creating endpoints that embody business processes or artifacts. This approach maps nicely to a business logic layer, and to Eric Evans' "domain-driven design."

For example, let's say you have an endpoint that returns data for an invoice so that it can be displayed on a screen or form to the end user. In a CRUD model, you would need several calls to your endpoints to assemble the necessary information: name, billing address, shipping address, line items. A single DTO from a single endpoint can return all of this information at once.

Robert Harvey
  • 200.7k
  • 55
  • 470
  • 683