[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?
[QUESTION] How do ACL and domain level security work?
50:28
Laur Spilca
Рет қаралды 7 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
Spring ultimate basics: What are Spring Beans and what is the Spring Container?
16:30
Response Body with Data Transfer Object - DTO in Spring Boot
17:44
Programming with Basar
Рет қаралды 10 М.
JAVA DTO Pattern Tutorial | Simplify Your Code
19:12
Amigoscode
Рет қаралды 223 М.
Use DTO instead of Model and Entity objects
8:11
Java Master
Рет қаралды 23 М.
Using DTOs with JPA
1:05:34
Laur Spilca
Рет қаралды 7 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН