SOLID Design Principles with Java Examples | Clean Code and Best Practices | Geekific

Поділитися
Вставка
  • Опубліковано 5 жов 2024

КОМЕНТАРІ • 61

  • @stphdr2771
    @stphdr2771 6 місяців тому +7

    First time as a student that I completly understand SOLID principles ! Thanks for the share.

  • @jimmytorres4181
    @jimmytorres4181 2 роки тому +32

    This video is amazing. Your channel is underrated, you're great at teaching

    • @geekific
      @geekific  2 роки тому +2

      Thank you so much :) I really appreciate it!

  • @elyakimlev
    @elyakimlev 2 роки тому +15

    Interesting and informative. I've used enums many times in my code, but now I see using an interface with classes implementing it would have been a better choice in many situations.
    I would just change one thing in the Liskov Substitution Principle example:
    Seeing specific Video member variables like title, likes and views under a class named VideoManager seems wrong to me. Instead, I would have left these member variables under the Video class and move the playRandomAd() method to VideoManager.
    PremiumVideo would still inherit from Video. That way, you also remove the need to duplicate the getNumbersOfHoursPlayed() in every subclass.

    • @geekific
      @geekific  2 роки тому +8

      Thank you :) Yup, well done! Why not, that is another way of doing it! This video is about the 'what' and not the 'how', we are just demonstrating what these principles are, feel free to implement them however you see fit!

    • @KokoShampiona
      @KokoShampiona Рік тому

      And what will happened if I then invoke new PremiumVideo.playRandomAd() - the method of the base class?

  • @jasper5016
    @jasper5016 Рік тому +3

    Your videos clear all my doubts. Thanks

  • @ppdmartell
    @ppdmartell Рік тому +2

    Best video I have ever seen on SOLID design principles!

  • @tassivisognon2247
    @tassivisognon2247 Рік тому +2

    best and straightforward video I have watched on this topic. Thanks you

  • @luisalamo2658
    @luisalamo2658 7 місяців тому

    Perfectly explained in 11 minutes! Thanks!

  • @imranyaseen3528
    @imranyaseen3528 2 роки тому +5

    This is an amazing video. Very easy to understand with examples. Please keep it up!

    • @geekific
      @geekific  2 роки тому +1

      Glad you liked it! More incoming... Stay Tuned :)

    • @lpandp90
      @lpandp90 10 місяців тому +1

      Agreed!! First time I really get all principles after a decade

  • @KizilBoss
    @KizilBoss 11 місяців тому +2

    thank you, I am always struggling with that in high level applications. The part with Dependency Inversion Principle helped me alot, well can you do a example with best practices lets say with have 5 moduls?

    • @geekific
      @geekific  11 місяців тому +2

      Glad it did! Will add it to my list of upcoming video, stay tuned!

  • @yobrangutez1470
    @yobrangutez1470 Рік тому

    You are God sent. Great content. Kindly recommend other channels that teach the way you do.

    • @geekific
      @geekific  Рік тому +1

      Thank you! Glad to be of help :) There are no specific channels, I just try to see as many references as I can before making a video to add on top of the stuff I already know.

  • @Korgoon
    @Korgoon Місяць тому

    The solution in Liskov substitution principle with VideoManager breaks the Single Responsibility Principle, now one class is responsible for two totally different behaviors.

  • @darkstudio3170
    @darkstudio3170 2 роки тому +1

    Underrated channel . Like and shared. Thanks a lot for the efforts🙏

    • @geekific
      @geekific  2 роки тому

      Thanks for the support :)

  • @jsimek
    @jsimek 6 місяців тому

    I am reading Clean Code and one thing I noticed is that Robert C. Martin recommends to avoid words like manager, processor, data or info in the names of a class, i.e. VideoManager at 7:14

    • @jsimek
      @jsimek 6 місяців тому

      but to be honest I have no idea what else to name it in this case

  • @cba2944
    @cba2944 Рік тому +1

    Underrated great explanation

  • @personalaccount1515
    @personalaccount1515 Місяць тому

    Excellent video

  • @vextronx
    @vextronx Рік тому +1

    These videos are extremely helpful, they deserve much more views. You are amazing!
    One question, doesn't the VideoManager class (at 7:16) violate the Single Responsibility Principle? I'm really not sure, it just seems a little strange. Does "managing a video" count as a single responsibility? Isn't that a bit too broad?

    • @geekific
      @geekific  Рік тому +1

      Thanks a lot! Since we are focusing in each part on one single principle and diving in its details, it won't be the cleanest way to actually solve the problem, but we can't explain them independently without doing that! So, yes, feel free to tear it apart and implement multiple specific interfaces :)

    • @vextronx
      @vextronx Рік тому

      @@geekific Thank you for the answer! :)

  • @t0khyo
    @t0khyo Рік тому

    The most underrated channel ever!

  • @Manuel-fp6ni
    @Manuel-fp6ni 3 місяці тому

    In Liskov's substitution is same to say: replace the child by its father or replace the father by its child? I see both ideas explaining this principle on the web

  • @lavankumargudipudi5926
    @lavankumargudipudi5926 7 місяців тому

    Very well explained..❤

  • @francksgenlecroyant
    @francksgenlecroyant 2 роки тому +1

    Super incredible, I enjoyed every single second

    • @geekific
      @geekific  2 роки тому +1

      Glad you enjoyed it! Happy to help :)

  • @Jody-nf2bz
    @Jody-nf2bz 8 місяців тому

    Really excellent! Thank you!

  • @thundley2039
    @thundley2039 6 місяців тому

    perfectly explained

  • @vinobabu7337
    @vinobabu7337 2 місяці тому

    Thanks for the video. Came up with a question. Is the VideoManager class in Liskov's Substitution Principle not violating SRP?

  • @Rob-J-BJJ
    @Rob-J-BJJ 10 місяців тому

    wow this video was beautifully made.

  • @vinayakgandhi5690
    @vinayakgandhi5690 Рік тому +2

    isn't the Liskov substitution principle the opposite of what shown in the video? i.e. Base type should be replaceable by the sub type?

    • @Lucretat
      @Lucretat Рік тому

      @@geekific OP is right, the text needs fixing, you got it the other way around. ;)

    • @PrasannaCE
      @PrasannaCE 8 місяців тому

      LSP is not updated yet with example Base type replace by sub type...

  • @christianrodier3381
    @christianrodier3381 5 місяців тому

    Super helpful

  • @JosephKiandaTshava
    @JosephKiandaTshava 5 місяців тому

    Thank you❤

  • @mart-b5610
    @mart-b5610 3 роки тому

    Absoloutly superb explanation! Thanx!!!

    • @geekific
      @geekific  3 роки тому

      Glad it was helpful! You're welcome :)

  • @doomguy1496
    @doomguy1496 Рік тому

    Very nice tutorial. Have a question tho regarding L. You will not be able to have a single collection of all videos now, or am I missing something here ?

    • @geekific
      @geekific  Рік тому

      Thanks! In this example yes, because we are focusing on one principle at one point in time. However, you should strive on keeping all of them in check, so the best practice would be to have specific interfaces implemented by the videos and use these instead.

    • @beep6091
      @beep6091 8 місяців тому

      i am d'accord@@geekific

  • @ebuzertahakanat
    @ebuzertahakanat 9 місяців тому

    good refresher

  • @sajisajisam6827
    @sajisajisam6827 2 роки тому

    Great video with great examples and explanation!

    • @geekific
      @geekific  2 роки тому

      Thank you :) Glad you liked it!

  • @mohamedrizk9361
    @mohamedrizk9361 2 роки тому

    Thanks sir, it's very clear

  • @jasper5016
    @jasper5016 Рік тому

    Is it possible for your to show us how to write clean or secure Java Springboot code? especially leveraging design patterns.

    • @geekific
      @geekific  Рік тому

      Of course, and it is actually in the making, will be uploaded in the SpringBoot playlist, don't have an exact timeline, but it will! Stay Tuned!

    • @beep6091
      @beep6091 8 місяців тому

      thanks you@@geekific

  • @aldoumene6201
    @aldoumene6201 Рік тому +1

    Does the Liskov principle always mean applying composition?

    • @geekific
      @geekific  Рік тому +3

      The principles state what the problem is but not the solution. So, you can use whatever means necessary to resolve them. Sometimes, creating specific interfaces could resolve this issue. In this video, we tried to explore different way to do that as much as possible! Cheers!

    • @aldoumene6201
      @aldoumene6201 Рік тому +1

      Thanks a lot for the fast reply also Happy new year to you bro!

  • @aznstride4325
    @aznstride4325 Рік тому

    For the open closed principle how would you avoid rewriting the driver code that instantiates all the classes that follows the open close principle?

    • @geekific
      @geekific  Рік тому +1

      It depends on your use-case. You may not need all of them (strategy-like) and if you do you can probably put them in a factory.

  • @pog_champ
    @pog_champ Рік тому

    very well made video!

  • @avatarsece
    @avatarsece Місяць тому

    Is it just me or I see no major difference between Liskov Principle and Dependency Inversion Principle?

  • @1CProgrammer
    @1CProgrammer Рік тому

    😂😭😁🤝