Тёмный
No video :(

Data Transfer Objects - What Are DTOs - Full PHP 8 Tutorial 

Program With Gio
Подписаться 53 тыс.
Просмотров 41 тыс.
50% 1

In this lesson, we learn about data transfer objects (DTO). We create a DTO object for the API classes we worked on in the last couple of lessons.
SOME OF THE WAYS YOU CAN SUPPORT THE CHANNEL
👍 Smash the like button
🤝 Subscribe to the channel & turn the notifications on
💬 Post comments, any feedback is greatly appreciated
⭐ Become a Patreon: / programwithgio
THANK YOU!
🛠️ TOOLS & SERVICES I USE
Digital Ocean Hosting - Get 100$ credit - m.do.co/c/38b9...
Domains on Namecheap - namecheap.pxf....
Envato Elements - 1.envato.marke...
LESSON 3.23
Course Outline - github.com/gge...
Course Playlist - • Learn PHP The Right Wa...
RESOURCES
Source Repo - github.com/gge...
** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.

Опубликовано:

 

21 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 91   
@Zubbee
@Zubbee 2 года назад
This seems like a very handy lesson. And this use case makes it real easy to understand. Thank you so much Gio. Moving on
@ProgramWithGio
@ProgramWithGio 2 года назад
Awesome, glad to hear. Thank you 🙌
@anonymizeratheist4885
@anonymizeratheist4885 2 года назад
Great content as usual, always thought that DTO something not needed, now I see real case where is needed Thanks 👍
@ProgramWithGio
@ProgramWithGio 2 года назад
Glad it was useful, thank you 🙏
@brunoggdev6305
@brunoggdev6305 Год назад
Exactly, same for me, what a great class
@maciejb486
@maciejb486 2 года назад
Thank you for great tutorials,i have found you recently and got interested from the get go.
@ProgramWithGio
@ProgramWithGio 2 года назад
Welcome to the channel :). Thank you, glad you liked it
@yusuperproactive9568
@yusuperproactive9568 2 года назад
Man keep it up, you are doing a great job. Thank god I found you
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you
@deryckoe84
@deryckoe84 2 года назад
Great content. Is one of the best DTO tutorials I have seen. Thanks!
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you 💙
@shaikhalamin23
@shaikhalamin23 2 года назад
Really a great content. waiting for your next video. Thanks
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you
@y299u2
@y299u2 Год назад
Thanks again, Gio! Very interesting topic. You mentioned many times Factory class, can you please talk in details about the design patterns? You did great describing OOP, and I beleive it's a good time to talk about design patterns once you have the time. Best wishes,
@ProgramWithGio
@ProgramWithGio Год назад
I'm thinking of making separate series for design patterns. Don't know if I'll cover it in this series since we are close to finish now. We'll see 👍
@KIKOmanasijev
@KIKOmanasijev Год назад
​@@ProgramWithGio Most of the tutorials are like 10 minutes short explanations of the Design Patterns themself. Having them in a format where you actually build/refactor (real world) larger apps would be terrific! So maybe a mini-series if you schedule allows it?
@ProgramWithGio
@ProgramWithGio Год назад
@@KIKOmanasijev I'll think about it, thank you
@serhiicho
@serhiicho Год назад
Awesome! Good explanation
@ProgramWithGio
@ProgramWithGio Год назад
Thank you 💙
@emekatimothyiloba699
@emekatimothyiloba699 Год назад
Well Explained Gio!! Thank you
@ProgramWithGio
@ProgramWithGio Год назад
You're welcome, thank you
@miratechsolutions5777
@miratechsolutions5777 Год назад
Great well explained video! Thanks for explaining such an architectural concepts :)
@ProgramWithGio
@ProgramWithGio Год назад
You're welcome $ thank you 🙌
@user-zh2oz9fe4m
@user-zh2oz9fe4m Год назад
That is an excellent explanation. Thanks a lot!
@ProgramWithGio
@ProgramWithGio Год назад
Glad it was helpful, thank you
@HadayatNiazi-xp1fz
@HadayatNiazi-xp1fz Год назад
Great Job sir
@ProgramWithGio
@ProgramWithGio Год назад
Thank you
@elmarzougui
@elmarzougui 2 года назад
Amazing content
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you 🙌
@devcast6414
@devcast6414 2 года назад
Thanks. Also waiting for DDD ))
@ProgramWithGio
@ProgramWithGio 2 года назад
I don't do much of DDD so I wouldn't feel comfortable teaching it yet.
@user-vi2fp6dl7b
@user-vi2fp6dl7b 4 месяца назад
Thank you very much!
@ProgramWithGio
@ProgramWithGio 4 месяца назад
You're welcome!
@constantinci
@constantinci 2 года назад
What else can I say? Great content as always.
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you 💙
@LiorCHAMLA
@LiorCHAMLA 2 года назад
FIRST ! Love your content
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you 🙌
@arduinoguru7233
@arduinoguru7233 2 года назад
Very Informative, keep the good work.
@ProgramWithGio
@ProgramWithGio 2 года назад
Thanks a lot 💙
@bevedel
@bevedel 2 года назад
Thank you so much for these great content. could you please introduce some resources or books about best practice architecture in software design? need more detail about service and repository layers. Thanks
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you. Cant think of a book for such a thing currently, I would say check Laracasts series if you have subscription, they have a lot of valuable lessons.
@mathdothings
@mathdothings 3 месяца назад
Wonderful video. Do you use some Brave extension to improve errors and warnings on the browser? Thank you!
@ProgramWithGio
@ProgramWithGio 3 месяца назад
Thank you. No, I don't use extensions
@rxxt-sh1vj
@rxxt-sh1vj 2 года назад
Can you also make a video on Middlewares ??
@ProgramWithGio
@ProgramWithGio 2 года назад
I won't have a video dedicated to middlewares but will mention what it is in a video where I cover SlimPHP framework. Should be coming out soon 👍
@memack101
@memack101 2 года назад
Thank you.
@ProgramWithGio
@ProgramWithGio 2 года назад
You're welcome
@lottotred
@lottotred 8 месяцев назад
Hey Gio! Great work! Does DTO can contain primitive data only or not? What's your opinion on that?
@genechristiansomoza4931
@genechristiansomoza4931 8 месяцев назад
DTO can contain another DTO. Just Imagine that you are creating another data type.
@ProgramWithGio
@ProgramWithGio 8 месяцев назад
As @genechristiansomoza4931 said, you can have other DTOs within your DTO
@ryanye6938
@ryanye6938 2 года назад
Finally!!!
@ProgramWithGio
@ProgramWithGio 2 года назад
😎
@dnxsol
@dnxsol 2 года назад
Basically a class of properties with a fancy name
@ProgramWithGio
@ProgramWithGio 2 года назад
Sort of, but not exactly
Месяц назад
A readonly class of properties with a fancy name 😁
@AbhinavKulshreshtha
@AbhinavKulshreshtha 2 года назад
This is nice tip. I have been using a similar design pattern. My pattern is based on javabean from my java days.
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you 💙
@DavidSmith-ef4eh
@DavidSmith-ef4eh 2 года назад
Cool stuff, now give the video on value objects and entities. I've been using them for quite a while, but still don't know what they are 🤣🤣
@ProgramWithGio
@ProgramWithGio 2 года назад
Yup, next video will be about value objects. We covered entities already, you can check the playlist.
@omarkandil1515
@omarkandil1515 2 года назад
keep it up
@ProgramWithGio
@ProgramWithGio 2 года назад
💙💙
@JanPavlikdr
@JanPavlikdr Год назад
I’m little bit confused… 7:16 you said that within the constructor just to pass params the object will know those values and properties and will return them inside the object?
@ProgramWithGio
@ProgramWithGio Год назад
Not sure what you mean, we are instantiating a new DTO object & returning that, we pass the arguments to constructor. DTOs are typically immutable meaning that values on the properties shouldnt change once they are set/passed in constructor, thats why we set them to readonly & made them public because they cant be changed
@JanPavlikdr
@JanPavlikdr Год назад
@@ProgramWithGio Constructor promotion, 20 years with PHP and didn’t catch this change 😀
@free2idol1
@free2idol1 Год назад
Thanks for great video... can you please make another video on other use cases of DTO or other recently popular design system in laravel like DDD?
@ProgramWithGio
@ProgramWithGio Год назад
Thanks for the suggestion 👍
@iamputhea
@iamputhea 2 года назад
Would you mind making a deep dive into Livewire?
@ProgramWithGio
@ProgramWithGio 2 года назад
I don't use Livewire so probably won't be making content on it anytime soon.
@kirayamato6128
@kirayamato6128 11 месяцев назад
you can use resource to do this instead of DTO. i don't understand why use DTO
@ProgramWithGio
@ProgramWithGio 11 месяцев назад
This is a lesson about DTOs and what is its purpose. Also how would you set up a resource here?
@firdavs.ibodullayev
@firdavs.ibodullayev Год назад
can we say that DTO is the realization of Adapter pattern ?
@ProgramWithGio
@ProgramWithGio Год назад
Not really, DTOs don't have any logic, they are dummy objects whose purpose is to transfer data.
@joshpennington
@joshpennington 2 года назад
How are you setting up the routes using a decorator??
@ProgramWithGio
@ProgramWithGio 2 года назад
We set up the routes as we have always done in the series. Nothing special, just registering them in the public/index.php. You can check previews videos about routing to see how that's set up
@ravendelarama426
@ravendelarama426 2 года назад
What's the difference between PDO and DTO?
@ProgramWithGio
@ProgramWithGio 2 года назад
PDO is a data access object, it has database abstraction, DTO is a data transfer object. Two different things.
@roozbehsharifzadeh9157
@roozbehsharifzadeh9157 2 года назад
Is this course over? How many sections is left?
@ProgramWithGio
@ProgramWithGio 2 года назад
Not over yet. This is the last section. Might make a fourth one for project, we'll see
@roozbehsharifzadeh9157
@roozbehsharifzadeh9157 2 года назад
@@ProgramWithGio so this means that the advanced sections is over and there is no part 24 , right?
@ProgramWithGio
@ProgramWithGio 2 года назад
@@roozbehsharifzadeh9157 not over yet, more videos will be published for this section.
@legonz5047
@legonz5047 Год назад
I still dont see where this is better then having an array which can be defined or just a class with propertys.
@ProgramWithGio
@ProgramWithGio Год назад
DTO is also a class with properties in a way. It's better than arrays in certain cases where you are accessing magical keys. API requests/responses are good candidates for DTOs or just even form requests that you pass to your model or service class.
@REBL0X3RSCREW
@REBL0X3RSCREW 2 года назад
Hello, what does this mean: unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST): class Test { public array $data; } Error on the $data line.
@ProgramWithGio
@ProgramWithGio 2 года назад
Check your PHP version, you are probably running 7.3 where type hints on properties are not allowed.
@REBL0X3RSCREW
@REBL0X3RSCREW 2 года назад
@@ProgramWithGio I used 7.3 then I chooses in cpanel 7.4 Now it works. But I have not 8.0 available lol
@drKatzman
@drKatzman 2 месяца назад
ConSHtruct, abSHtract
@ProgramWithGio
@ProgramWithGio Месяц назад
English is my second language, so I do pronounce some things in a funny way sometimes :D
@schattopadhyay1901
@schattopadhyay1901 2 года назад
Can you please make a video on setting up a full fledged payment gateway in a website..using php?
@ProgramWithGio
@ProgramWithGio 2 года назад
Thanks for the suggestion, noted
@securecodingdevelopment5023
@securecodingdevelopment5023 2 года назад
excelent thanks! subscribe now
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you 💙
Далее
would you eat this? #shorts
00:29
Просмотров 638 тыс.
5 Rules For DTOs
17:56
Просмотров 40 тыс.
Why use Type and not Interface in TypeScript
14:12
Просмотров 201 тыс.
Laravel + Livewire todo app (and so much more)
16:41
Просмотров 39 тыс.
I've been using Redis wrong this whole time...
20:53
Просмотров 353 тыс.
Master Golang with Interfaces
21:54
Просмотров 11 тыс.
would you eat this? #shorts
00:29
Просмотров 638 тыс.