Skip to main content

Questions tagged [dto]

Data Transfer Objects are for moving data between processes.

Filter by
Sorted by
Tagged with
0 votes
2 answers
204 views

I am doing the frontend for a Java Spring backend. The project uses JavaFX for the front but I a migrating it for web usage (with VueJS). When I make an API call to retrieve an object, I am receiving ...
Bernardo Benini Fantin's user avatar
0 votes
2 answers
177 views

I'm working on a TypeScript application designed with DDD and using layered architecture. My infra layer has a repository that fetches a complex, nested DTO. My current implementation maps this DTO ...
Bernardo Benini Fantin's user avatar
2 votes
0 answers
153 views

We know that combining a domain entity, a DTO, and a REST API serialization class into one won't pass code review: @JsonInclude(JsonInclude.Include.NON_NULL) @Data @Builder @Entity @Table(name = "...
sfinja's user avatar
  • 129
0 votes
3 answers
502 views

Say I'm building my own backend framework (really I'm just learning) and I have a simple class: class User { String email String passwordHash Date birthdate Int getAge() { ...
Mahi's user avatar
  • 406
1 vote
3 answers
622 views

Yesterday I screwed up: One of the classes of my C# contained a property, called "DeliverdQuantity" (yep, there's a spelling mistake indeed). When I saw that, I decided to correct that, ...
Dominique's user avatar
  • 1,844
0 votes
1 answer
444 views

It might be that my question would sound a bit stupid but I would like to find the best way for naming my DTO interfaces. In my PHP application I have following DTO types: Simple (which contains a ...
Viacheslav Ravdin's user avatar
1 vote
1 answer
222 views

I'm developing a PHP application and trying to understand DTOs in context of single-responsibility principle. Being more specific, is it a bad practice having helper methods like toArray(), getValue(),...
Viacheslav Ravdin's user avatar
1 vote
5 answers
1k views

If I have for example a User POJO like the following @AllArgsConstructor public class User { @Id private final String id; private String username; private String password; private Date createdDate;...
iqueqiorio's user avatar
3 votes
4 answers
2k views

I have a Spring service that acts as an adapter for another service in my company. The service receives a request to generate push notifications for a given user and needs to call the other service ...
VariabileAleatoria's user avatar
1 vote
4 answers
3k views

When retreiving data with an api and saving it in a DTO, some values are nullable: null on initial class initialization but VS also warns you for this. For example, an employee: public class ...
Jannick Breunis's user avatar
2 votes
1 answer
384 views

I feel something is wrong with my approach handling MVP and the Repository Pattern. I'm making an album winform app just to practice MVP, crud and the Repos. Pattern. First some code. The model: using ...
Valmont's user avatar
  • 193
0 votes
1 answer
3k views

I have a 3 layer architecture application with presentation layer, business layer and data access layer. UI -> BLL -> DAL UI Layer has reference to only BLL and BLL refer only to DAL. My BLL has ...
Alfons Deda's user avatar
1 vote
2 answers
2k views

Say that I have a REST endpoint for a chess server. If I'm not logged in and do a GET on /games I could get all running games like: { running_games: [ ..... ] } but if I'm logged in I ...
tonicebrian's user avatar
-1 votes
1 answer
509 views

I interessted in the "usecases" and "how they interacts with the "context" at "clean architecture". If I understand right, there will be two contexts. First is the ...
Cit's user avatar
  • 21
0 votes
3 answers
2k views

I'm about to create a service providing a simple CRUD Json REST-API. The main requirement is that documents stored/received always conform to a schema provided as JSON schema. So here's the thing: ...
Jan Gassen's user avatar
0 votes
1 answer
1k views

Lets say we have DTO class with 15 properties. Usually DTOs like these are mapped from other objects. But sometimes some DTOs may use values from multiple objects. In these cases, should we “Map” or “...
Gintaras's user avatar
0 votes
0 answers
426 views

I want to know the best Practice is about having multiple dto’s for different use cases. Let’s say we have an api with a set of controllers to handle requests coming from a administration backend and ...
Martin C's user avatar
0 votes
1 answer
215 views

This question might seem like a trivial question. But here it goes. Currently, I'm working with this .NET Core application, an N-tier application consisting of a Vue frontend, business logic layer, ...
XRaycat's user avatar
  • 131
3 votes
4 answers
5k views

I'm looking for some guidance. Is it a bad practice to use transformation functions within DTO objects? I have this example public partial class AgEmpDto { private DateTimeOffset ...
Udemytur's user avatar
  • 205
0 votes
1 answer
88 views

I am writing a control app for a 6-DOF robot. This app can send scripts to the robot, which in turn executes these and thus moves around. In the app a robotprogram can be created by adding 3D ...
Gertjan Brouwer's user avatar
1 vote
3 answers
1k views

I'm building a Use Case for creating blog posts, this Use Case has its own "DTO", which is basically a parameter object with only primitive data, as follows: Use Case's DTO (Parameter Object)...
Thiago Dias's user avatar
1 vote
0 answers
1k views

Suppose I have a Controller that takes a DTO that represents an Order. This DTO has inner DTOs that could potentially have entity IDs and/or entity data that's used to create an entity dynamically ...
Morgan's user avatar
  • 111
1 vote
1 answer
646 views

I have a scenario in which an Entity defines an EntityRepresentation that is created from another end. The EntityRepresentation is a value object that implements some logic that should be performed on ...
Antonio Santoro's user avatar
2 votes
3 answers
11k views

Hi I am very new to using DTOs, and I am starting to understand it slowly, but there are still some missing puzzles for me. I understand the use of DTOs in the way of decoupling the persistence data ...
user9347049's user avatar
0 votes
2 answers
4k views

I'm implementing the validation layer for a certain method on a controller, namely I need to check if certain image ids passed do really belong to the user making a request. In order to do that I need ...
Albert's user avatar
  • 109
0 votes
2 answers
1k views

We have a table design in our database to dynamically store settings: You wouldn't need to understand every column in the table but basically tbl_Setting defines all possible settings and ...
OPunktSchmidt's user avatar
7 votes
2 answers
6k views

Following the classic 3 layer architecture domain Model (a list of domain models live there and has no dependencies) DAL layer - My Repositories lives there with DBContext implementation (Ado.net) ...
Stelios's user avatar
  • 235
2 votes
0 answers
644 views

I am trying to come up with a design for an application I am working on. Here is a basic picture of what I am looking to do. Everything up to the Data Layer is totally fine but the Data Layer makes ...
Muhand Jumah's user avatar
4 votes
3 answers
2k views

Let's say there's the class Book, with different models in different endpoints: Endpoint A (consumer): class Book{ Map<string,string> chapterName_content } Endpoint B (provider): class Book{ ...
Carlos Coelho's user avatar
1 vote
2 answers
3k views

So, I have project in which several WebServices will be created (REST). For the sake of simplicity, Lets name them A, B, and C. A and B handle different tasks, but both of them consume C, which is the ...
SonneRevsson's user avatar
0 votes
2 answers
1k views

Following the hexagonal architecture and package design you will have somewhere an entry point reaching to your core functionality. Often this is done by using a facade. To hide the core logic from ...
Jim Panse's user avatar
  • 408
0 votes
1 answer
662 views

I have a collection /users/{userId}/tools and I want to GET and POST to that collection. Can I have different representation of that object based on the method? For example, for POST I want to send ...
TheEmpire12's user avatar
2 votes
1 answer
5k views

I am working on a WebAPI application which follows the layered approach like Controller > Service Layer > Repository Layer > Entity Framework Core (SQL / Cosmos) The view is in Angular. In many of ...
Guru Pasupathy's user avatar
0 votes
1 answer
7k views

Given the following architecture and frameworks: Spring Boot Application with Spring Data JPA (Hibernate is used as OR mapper); layered architecture as followed. REST layer Service layer Persistence ...
keezar's user avatar
  • 27
-6 votes
1 answer
176 views

From what I have read about the domain driven design, an aspect of it is that there is a clear separation between domain objects and DTOs. So the application level components deal with domain objects ...
Jim's user avatar
  • 359
-2 votes
1 answer
466 views

I am writing a program in Kotlin which parses some input data and writes it to a MySQL database (through JDBC). The database includes tables such as users and each table has a corresponding data ...
Farbod Salamat-Zadeh's user avatar
-1 votes
1 answer
145 views

Assume we have data structure objects - some of them are DTOs and some of them are VOs. Also assume that Value Objects are immutable and Data Transfer Objects are immutable and readonly, then: How ...
Daniel Iwaniec's user avatar
0 votes
1 answer
1k views

The application that I am working on has numerous ...toMany relations, e.i. class Model can have several parameters. In Unidirectional world, it is simple to manage a collection. I can clean the ...
Serafins's user avatar
  • 119
3 votes
4 answers
2k views

I work with Spring applications. Recently I have found this article about the Anemic Domain Model. They recommend putting logic in Entity classes. It solves a problem that Martin Fowler described in ...
Valerii Sloboda's user avatar
-2 votes
1 answer
430 views

I was given a solution with many projects. Multiple projects call multiple REST APIs. These calls are scattered around the spaghetti code. Trying to figure out what calls are done in what sequence ...
user2263986's user avatar
3 votes
4 answers
496 views

Sorry about the vague question, please do suggest different formulations. Anyway here is the kernel of the question: How many classes representing an entity/resource or whatever you want to call it, ...
Pavel Schoffer's user avatar
1 vote
1 answer
195 views

Is there a way or design pattern to add supporting information to the existing java object? Example I have a model class Parent and it has child models. Its nothing but hibernate entities with parent-...
Javee's user avatar
  • 19
1 vote
2 answers
288 views

I'm new to micro service architecture and I'm looking to understand how services should/can interact with each other. The acceptance for my current story requires me to: Email a document Backup the ...
furiousgreg's user avatar
12 votes
3 answers
18k views

Are data transfer objects or POJOs meant to be final or can they be extended and create hierarchies for them? It is not clear to me if such a value class is properly designed only as a final class and ...
Jim's user avatar
  • 359
4 votes
3 answers
2k views

Let's suppose I have the following objects in my domain: class Warehouse { int Id; string Address; Item[] Inventory; } class Item { int Id; string Name; int Price; int ...
user avatar
3 votes
1 answer
807 views

I'm extending an existing application, which has an attempt at a logical tier design, using DTOs, a Services layer (business logic), and a DAL. However, as I'm investigating more about DTOs, my ...
HardCode's user avatar
  • 674
-2 votes
2 answers
360 views

This is maybe a strange question, but I just trying to understand my colleague. I know what is DTO, and what should be on it, but not that long time ago I found the whole micro-service written on the ...
Darkves's user avatar
  • 107
0 votes
0 answers
900 views

I am in the middle of starting up a new project and just wanted some reassurance as to which approach to DTO's returned by the read-side was easier to maintain in a real world application with ...
Too Many Questions's user avatar
0 votes
3 answers
2k views

According to this article: Using Ids in Domain Models is not a good practice. We should reference the entire domain model instead. In this case, when we want to provide only Getters for our ...
Dree Droo's user avatar
0 votes
1 answer
642 views

I'm developing a web application for academic purposes. What i have to do is a simple website which keeps track of realties along with their respective owners and the tags they are bound to. The ...
cidra's user avatar
  • 363