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

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ม.ค. 2025

ความคิดเห็น • 95

  • @megyptmEgy
    @megyptmEgy 20 วันที่ผ่านมา

    Thank you so much for the amazing PHP courses you share online! Your tutorials have been a game-changer for me, and I can't express how much I’ve learned from your clear and practical explanations.
    Your passion for teaching and your ability to simplify complex concepts have inspired me to keep growing as a developer. I'm so grateful for all the effort and dedication you put into helping people like me learn and improve.
    Keep up the fantastic work-you’re making a real difference in the lives of so many aspiring developers!

    • @ProgramWithGio
      @ProgramWithGio  17 วันที่ผ่านมา

      Thank you for kind words 💙

  • @Zubbee
    @Zubbee 2 ปีที่แล้ว +7

    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 ปีที่แล้ว +13

    Great content as usual, always thought that DTO something not needed, now I see real case where is needed
    Thanks 👍

    • @ProgramWithGio
      @ProgramWithGio  2 ปีที่แล้ว +3

      Glad it was useful, thank you 🙏

    • @brunoggdev6305
      @brunoggdev6305 ปีที่แล้ว

      Exactly, same for me, what a great class

  • @maciejb486
    @maciejb486 2 ปีที่แล้ว +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

  • @deryckoe84
    @deryckoe84 2 ปีที่แล้ว +2

    Great content. Is one of the best DTO tutorials I have seen. Thanks!

  • @yusuperproactive9568
    @yusuperproactive9568 2 ปีที่แล้ว +1

    Man keep it up, you are doing a great job. Thank god I found you

  • @serhiicho
    @serhiicho 2 ปีที่แล้ว +1

    Awesome! Good explanation

  • @emekatimothyiloba699
    @emekatimothyiloba699 ปีที่แล้ว

    Well Explained Gio!! Thank you

  • @shaikhalamin23
    @shaikhalamin23 2 ปีที่แล้ว +1

    Really a great content. waiting for your next video. Thanks

  • @Vitalii-m6r
    @Vitalii-m6r ปีที่แล้ว

    That is an excellent explanation. Thanks a lot!

  • @HadayatNiazi-xp1fz
    @HadayatNiazi-xp1fz ปีที่แล้ว

    Great Job sir

  • @elmarzougui
    @elmarzougui 2 ปีที่แล้ว +1

    Amazing content

  • @АртурЗарипов-б2й
    @АртурЗарипов-б2й 9 หลายเดือนก่อน

    Thank you very much!

  • @miratechsolutions5777
    @miratechsolutions5777 2 ปีที่แล้ว

    Great well explained video!
    Thanks for explaining such an architectural concepts :)

  • @arduinoguru7233
    @arduinoguru7233 2 ปีที่แล้ว

    Very Informative, keep the good work.

  • @memack101
    @memack101 2 ปีที่แล้ว

    Thank you.

  • @LiorCHAMLA
    @LiorCHAMLA 2 ปีที่แล้ว +1

    FIRST ! Love your content

  • @devcast6414
    @devcast6414 2 ปีที่แล้ว +1

    Thanks. Also waiting for DDD ))

    • @ProgramWithGio
      @ProgramWithGio  2 ปีที่แล้ว +1

      I don't do much of DDD so I wouldn't feel comfortable teaching it yet.

  • @y299u2
    @y299u2 2 ปีที่แล้ว +3

    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  2 ปีที่แล้ว +4

      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 2 ปีที่แล้ว +2

      ​@@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  2 ปีที่แล้ว +1

      @@KIKOmanasijev I'll think about it, thank you

  • @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 😀

  • @mathdothings
    @mathdothings 8 หลายเดือนก่อน

    Wonderful video. Do you use some Brave extension to improve errors and warnings on the browser?
    Thank you!

    • @ProgramWithGio
      @ProgramWithGio  8 หลายเดือนก่อน

      Thank you. No, I don't use extensions

  • @constantinci
    @constantinci 2 ปีที่แล้ว +1

    What else can I say? Great content as always.

  • @rxxt-sh1vj
    @rxxt-sh1vj 2 ปีที่แล้ว +1

    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 👍

  • @bevedel
    @bevedel 2 ปีที่แล้ว +1

    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.

  • @lottotred
    @lottotred ปีที่แล้ว

    Hey Gio! Great work!
    Does DTO can contain primitive data only or not? What's your opinion on that?

    • @genechristiansomoza4931
      @genechristiansomoza4931 ปีที่แล้ว +1

      DTO can contain another DTO. Just Imagine that you are creating another data type.

    • @ProgramWithGio
      @ProgramWithGio  ปีที่แล้ว

      As @genechristiansomoza4931 said, you can have other DTOs within your DTO

  • @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

  • @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.

  • @omarkandil1515
    @omarkandil1515 2 ปีที่แล้ว

    keep it up

  • @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.

  • @free2idol1
    @free2idol1 2 ปีที่แล้ว

    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?

  • @AbhinavKulshreshtha
    @AbhinavKulshreshtha 2 ปีที่แล้ว +1

    This is nice tip.
    I have been using a similar design pattern. My pattern is based on javabean from my java days.

  • @ryanye6938
    @ryanye6938 2 ปีที่แล้ว

    Finally!!!

  • @benderbg
    @benderbg 4 หลายเดือนก่อน

    Interestingly enough I didn't have a single error when using string $score in EmailValidationResult constructor for both Emailable and Abstract APIs.

    • @ProgramWithGio
      @ProgramWithGio  3 หลายเดือนก่อน

      Do you have strict types declaration on top of the file?

  • @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 ปีที่แล้ว +1

      Yup, next video will be about value objects. We covered entities already, you can check the playlist.

  • @firdavs.ibodullayev
    @firdavs.ibodullayev 2 ปีที่แล้ว

    can we say that DTO is the realization of Adapter pattern ?

    • @ProgramWithGio
      @ProgramWithGio  2 ปีที่แล้ว +1

      Not really, DTOs don't have any logic, they are dummy objects whose purpose is to transfer data.

  • @ravendelarama426
    @ravendelarama426 2 ปีที่แล้ว

    What's the difference between PDO and DTO?

    • @ProgramWithGio
      @ProgramWithGio  2 ปีที่แล้ว +2

      PDO is a data access object, it has database abstraction, DTO is a data transfer object. Two different things.

  • @dnxsol
    @dnxsol 2 ปีที่แล้ว

    Basically a class of properties with a fancy name

    • @ProgramWithGio
      @ProgramWithGio  2 ปีที่แล้ว

      Sort of, but not exactly

    •  6 หลายเดือนก่อน

      A readonly class of properties with a fancy name 😁

  • @kirayamato6128
    @kirayamato6128 ปีที่แล้ว

    you can use resource to do this instead of DTO. i don't understand why use DTO

    • @ProgramWithGio
      @ProgramWithGio  ปีที่แล้ว

      This is a lesson about DTOs and what is its purpose. Also how would you set up a resource here?

  • @legonz5047
    @legonz5047 2 ปีที่แล้ว

    I still dont see where this is better then having an array which can be defined or just a class with propertys.

    • @ProgramWithGio
      @ProgramWithGio  2 ปีที่แล้ว

      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.

  • @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

  • @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

  • @securecodingdevelopment5023
    @securecodingdevelopment5023 2 ปีที่แล้ว

    excelent thanks! subscribe now

  • @drKatzman
    @drKatzman 7 หลายเดือนก่อน

    ConSHtruct, abSHtract

    • @ProgramWithGio
      @ProgramWithGio  6 หลายเดือนก่อน

      English is my second language, so I do pronounce some things in a funny way sometimes :D