No BS SOLID Principles

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

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

  • @bpdkuikel
    @bpdkuikel 9 หลายเดือนก่อน +4

    I must thank you for your amazing efforts in taking PHP to general people and creating lots of awareness. 🎉🎉🎉

    • @GaryClarkeTech
      @GaryClarkeTech  9 หลายเดือนก่อน +2

      Love the kind words!

  • @jorditrigo9569
    @jorditrigo9569 9 หลายเดือนก่อน +1

    Many thanks for sharing your knowledge, Gary!

    • @GaryClarkeTech
      @GaryClarkeTech  9 หลายเดือนก่อน +1

      My pleasure! Thanks for watching!

  • @Kogemate
    @Kogemate 9 หลายเดือนก่อน +1

    Great video!!! Everybody who want more durable code should understand these concept.

  • @astev52
    @astev52 9 หลายเดือนก่อน +1

    Love your work!

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

    Coooll❤❤

  • @commanderbensisko
    @commanderbensisko 9 หลายเดือนก่อน +2

    Hi Gary.
    I'm just curious why you didn't make SmsDispatcher and Mailer inherit from Notifier and then use a type of Notifier in your code ?

    • @GaryClarkeTech
      @GaryClarkeTech  9 หลายเดือนก่อน +1

      A Notifier interface or abstract Notifier class would be the best solution but I didn't want to start delving into dependency inversion in the SRP example...it might have become a distraction.

  • @thenightwolf224
    @thenightwolf224 9 หลายเดือนก่อน +1

    Amazing Video Buddy Keep Going ❤🔥

    • @GaryClarkeTech
      @GaryClarkeTech  9 หลายเดือนก่อน

      Thanks a lot...appreaciated!

  • @ta-mas
    @ta-mas 8 หลายเดือนก่อน

    Hello Gary,
    Great video, it was really really helpful! At the ISP part, let's say not just the archiver needs to read the file to do an operation on it. How should I handle that? Maybe break the interface into even smaller parts, so I have a FileReaderInterface a FileArchiverInterface and an Interface for my other operation that I want to imeplement?
    Thank you for the amazing content!!

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

      Cheers for the kind words...
      Yes just break it up and implement as many interfaces as you need

  • @dandan-js2ir
    @dandan-js2ir 7 หลายเดือนก่อน

    Hi. Great video! One question though regarding Open/Close principle. How to deal with vendor/ directory classes that does not implement an interface? Let's say there is a x package in vendor directory, and that package has a regular class that performs some task (without implementing any interface nor extending an abstract class). How to add Decorator pattern in such case? Thank you and cheers!

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

      That gets a bit more complex. If you need its functionality you can inject it as a dependency into your own class which does implement the interface. But try to avoid putting square pegs in round holes if it's going to cause more problems than it solves.

    • @dandan-js2ir
      @dandan-js2ir 7 หลายเดือนก่อน

      @@GaryClarkeTech Thank you for response!

  • @Kogemate
    @Kogemate 9 หลายเดือนก่อน +1

    For the first example, instead of encapsulation, I would use an interface. And only if the class that I am trying to inject does not implements the interface (like an open source class), I would create this class. Actually, it is a classic design pattern. Globally, it is better to rely on interface which is better than abstraction which is better than concrete class. :)

    • @GaryClarkeTech
      @GaryClarkeTech  9 หลายเดือนก่อน +2

      You're right..but I didn't want to delve into dependency inversion before I got to it..it might have become a distraction.

    • @Kogemate
      @Kogemate 9 หลายเดือนก่อน

      @@GaryClarkeTech You were actually right not to do it, too much complexity for nothing. BTW, I learned everything about these concept from Miško Hevery (he was Mr Writing-testable-code evangelist at Google). If you google his name, you will find amazing pdfs and yt videos. Lots of tips. As it is a little old, we can see what aged well (almost everything). Take care.

  • @BarMineL
    @BarMineL 9 หลายเดือนก่อน

    This is what I need