Questions tagged [dto]

Data transfer object (DTO) is an object that carries data between processes. The motivation for its use has to do with the fact that communication between processes is usually done resorting to remote interfaces (e.g. web services), where each call is an expensive operation.

Filter by
Sorted by
Tagged with
2 votes
1 answer
77 views

Is it good way to user dao when assembling dto to entity or not?

I have User entity that has relationship to other entities(Order,Profile) When I assemble entity from dto and back I need assemble order and profile entity too. User entity: ...
user avatar
2 votes
1 answer
62 views

API endpoint that returns phone numbers

Background An API endpoint that returns phone numbers. I would appreciate some feedback on this very simple service class that is part of the overall solution. Here is its Interface: ...
user avatar
  • 422
0 votes
1 answer
73 views

Business Layer Using DTOs and DataTables

I have a business logic layer class for creating and updating work orders, it also retrieves existing work order details from the database and displays it to the user on a form. The business logic ...
user avatar
3 votes
0 answers
7k views

Mapping Entities to DTOs in TypeScript

In a recent project my backend architecture consists of Repositories (talking to database) Services (handling business logic) <...
user avatar
  • 131
5 votes
1 answer
159 views

Replacing Uri with a more convenient class

I needed some data structure for holding Uris so I thought I try the Uri class. It quickly turned out that it's very impractical because: it's missing an implicit ...
user avatar
  • 43.8k
4 votes
1 answer
74 views

Preparing tabular data to be sent as json

I query a database and pass the data for processing as a DataTable. After all computations (grouping, filtering, formatting etc.) I need to send it to a Web-Service ...
user avatar
  • 43.8k
1 vote
1 answer
887 views

Return combined DTO from async controller

I have an asynchronous controller. It is supposed to make a couple async calls then return combined data from then as one DTO. ...
user avatar
  • 177
2 votes
0 answers
305 views

Generic Builder in Java needs annotation support

I was thinking about how to minimize the code needed to implement a builder. There is some code that any builder needs to have: Temporary storage of property values Validation of type Null check ...
user avatar
4 votes
1 answer
1k views

Code for a Person DTO, with tests

My needs are to manage DTO in a php5.3 application. I've written few lines of code in TDD with phpunit 6. The scenario I want to implement is a request with following fields: name surname password ...
user avatar
0 votes
1 answer
7k views

Map a hierarchy of nested DTO objects to a list of business objects [closed]

Consider I download my data into this data structures: ...
user avatar
1 vote
1 answer
8k views

Mapping interface between POJOs and DTOs

Following up on this question DTO interfaces for implementing web service integration I came up with this implementation. Data Transfer Object interface following a java.util.Map protocol. The ...
user avatar
  • 141
3 votes
1 answer
3k views

DTO interfaces for implementing web service integration

I am trying to define some interfaces to implement some web service integration middleware. The SOA pattern that fits this system is probably the Multi-Channel Endpoint. I expect a lot of mapping of ...
user avatar
  • 141
2 votes
1 answer
408 views

Passing a DTO into a static domain 'Create' method

I'm wondering if it's bad practice to couple my DTO to my domain object like this and pass the object itself into Create(). Is it better to just give the parameters ...
user avatar
6 votes
1 answer
538 views

Implementing a domain model

My domain model consists mostly of simple DTOs, i.e. 'Data Transfer Objects' which this article distinguishes from 'Plain Old C# Objects', like this one: ...
user avatar
4 votes
1 answer
116 views

Is the "current connected user" an information that should be shared with the domain?

I'm working right now in a readers social network. The main points are this: When an user connects with his account I save his user id in the session variable. My MVC is working with DTO's all the ...
user avatar
  • 143