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.
17 questions
3
votes
1
answer
95
views
DTO mapping feels too cumbersome for inherited record and class
Simply put, we're creating a system that creates documents. All documents have some basic properties. Then the inherited classes have additional fields that are specific to the type of document. The ...
2
votes
2
answers
108
views
JAVA - Validating User inputs on service methods in a cleaner way
In a project, we use service methods, there, we have to validate certain required inputs for our business logic to work:
...
2
votes
1
answer
174
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:
...
2
votes
1
answer
99
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:
...
0
votes
1
answer
120
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 ...
3
votes
0
answers
10k
views
Mapping Entities to DTOs in TypeScript
In a recent project my backend architecture consists of
Repositories (talking to database)
Services (handling business logic)
<...
5
votes
1
answer
269
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 ...
4
votes
1
answer
122
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 ...
2
votes
1
answer
1k
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.
...
2
votes
0
answers
320
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
...
4
votes
1
answer
2k
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
...
0
votes
1
answer
8k
views
Map a hierarchy of nested DTO objects to a list of business objects [closed]
Consider I download my data into this data structures:
...
3
votes
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 ...
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 ...
2
votes
1
answer
460
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 ...