[QUESTION] What is a DTO and how should I use it?

  Рет қаралды 10,531

Laur Spilca

Laur Spilca

Күн бұрын

In this video, we discuss what Data Transfer Objects (DTOs) are and how should you use them.
Code on GitHub: github.com/lsp...

Пікірлер: 14
@radub6436
@radub6436 4 жыл бұрын
This channel has the most comprehensive videos about the java language!
@abhishekr9829
@abhishekr9829 4 жыл бұрын
Thank you for the video, I was looking for DTO and it helped me a lot.
@sky2721
@sky2721 4 жыл бұрын
I think you should make the playlist about design pattern later in the future :D.. nice video anyway...
@laurspilca
@laurspilca 4 жыл бұрын
Thanks! Good advice. I made a note!
@lts8683
@lts8683 4 жыл бұрын
@@laurspilca + solid principal thanks you
@StefanBanu
@StefanBanu 3 жыл бұрын
I want this topic too. 😊
@madastan4169
@madastan4169 4 жыл бұрын
It isn`t better to import Product class as a jar?
@laurspilca
@laurspilca 4 жыл бұрын
Hi. Thanks for the question. I'm not sure I understand your question, but I guess you meant if you have two apps create a separate JAR containing the DTO and import it in the other two. If this is the case, the answer is: "It depends". Sometimes you can't do this, for example, if the two apps are not both part of your organization. In other cases, developers prefer avoiding to complicate the deployment (which might also make sense if there's not so much duplication) and so on. Like almost everything else in software, the right decision depends on the specific case. I hope I answered your question :)
@anil2009
@anil2009 4 жыл бұрын
Is this the start of microservices sir??
@laurspilca
@laurspilca 4 жыл бұрын
Hi. No, not yet. I just answered a question asked by someone. When I'll start with the software architecture part I'll make a stream with numbered lessons so that it's easy for everyone to follow them :)
@Seff2
@Seff2 2 жыл бұрын
I could not follow this tutorial. Too confusing. Why are there two Services? Couldn you just call the endpoints with Postman?
@laurspilca
@laurspilca 2 жыл бұрын
Hi. The reason there're two services is to make the point of what a DTO is. By definition DTO = Data Transfer Object. The reason you have the "transfer" word there is because it helps transferring data between apps. Yes, of course, one can assume Postman is the other app, but to make it more realistic, I preferred to have two services. I hope it makes sense. Cheers!
@madastan4169
@madastan4169 4 жыл бұрын
You should use meaningful names. Also, the logic should be in a service class. Regarding the package naming and the controller name, you should use nouns which are at their singular form.
@laurspilca
@laurspilca 4 жыл бұрын
Hi Mada. I agree with you. But what does this have to do with DTOs, which is the topic discussed?
Using DTOs with JPA
1:05:34
Laur Spilca
Рет қаралды 7 М.
JAVA DTO Pattern Tutorial | Simplify Your Code
19:12
Amigoscode
Рет қаралды 223 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
DTO - Data Transfer Object паттерн в JavaScript / PHP / C#
18:05
Максим Гром
Рет қаралды 4,2 М.
Why do we use DTOs in our APIs?
26:15
Codewrinkles
Рет қаралды 9 М.
Why use DTOs (Data Transfer Objects)?
7:23
CodeOpinion
Рет қаралды 75 М.
Microservices explained - the What, Why and How?
18:30
TechWorld with Nana
Рет қаралды 916 М.
the right way to organise your code
17:33
Amigoscode
Рет қаралды 205 М.
Use DTO instead of Model and Entity objects
8:11
Java Master
Рет қаралды 23 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН