In this video, we discuss what Data Transfer Objects (DTOs) are and how should you use them. Code on GitHub: github.com/lsp...
Пікірлер: 14
@radub64364 жыл бұрын
This channel has the most comprehensive videos about the java language!
@abhishekr98294 жыл бұрын
Thank you for the video, I was looking for DTO and it helped me a lot.
@sky27214 жыл бұрын
I think you should make the playlist about design pattern later in the future :D.. nice video anyway...
@laurspilca4 жыл бұрын
Thanks! Good advice. I made a note!
@lts86834 жыл бұрын
@@laurspilca + solid principal thanks you
@StefanBanu3 жыл бұрын
I want this topic too. 😊
@madastan41694 жыл бұрын
It isn`t better to import Product class as a jar?
@laurspilca4 жыл бұрын
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 :)
@anil20094 жыл бұрын
Is this the start of microservices sir??
@laurspilca4 жыл бұрын
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 :)
@Seff22 жыл бұрын
I could not follow this tutorial. Too confusing. Why are there two Services? Couldn you just call the endpoints with Postman?
@laurspilca2 жыл бұрын
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!
@madastan41694 жыл бұрын
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.
@laurspilca4 жыл бұрын
Hi Mada. I agree with you. But what does this have to do with DTOs, which is the topic discussed?