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

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ธ.ค. 2024

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

  • @stphdr2771
    @stphdr2771 9 หลายเดือนก่อน +10

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

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

    Your videos are some of the best OOP videos I found on TH-cam. I binge watched most of the videos, and they are one of the clearest OOP tutorials I have seen.

    • @geekific
      @geekific  2 หลายเดือนก่อน

      Glad to read it! Thank you :)

  • @jimmytorres4181
    @jimmytorres4181 3 ปีที่แล้ว +33

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

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

      Thank you so much :) I really appreciate it!

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

    Best video I have ever seen on SOLID design principles!

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

    Perfectly explained in 11 minutes! Thanks!

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

    Your videos clear all my doubts. Thanks

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

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

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

    The most underrated channel ever!

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

    Underrated great explanation

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

    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?

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

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

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

    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 9 หลายเดือนก่อน +1

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

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

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

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

      Thanks for the support :)

  • @lavankumargudipudi5926
    @lavankumargudipudi5926 10 หลายเดือนก่อน

    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 :)

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

  • @Jody-nf2bz
    @Jody-nf2bz 11 หลายเดือนก่อน

    Really excellent! Thank you!

  • @Rob-J-BJJ
    @Rob-J-BJJ ปีที่แล้ว

    wow this video was beautifully made.

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

    Excellent video

  • @Korgoon
    @Korgoon 4 หลายเดือนก่อน +1

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

  • @mart-b5610
    @mart-b5610 3 ปีที่แล้ว

    Absoloutly superb explanation! Thanx!!!

    • @geekific
      @geekific  3 ปีที่แล้ว

      Glad it was helpful! You're welcome :)

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

    perfectly explained

  • @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! :)

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

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

  • @sajisajisam6827
    @sajisajisam6827 3 ปีที่แล้ว

    Great video with great examples and explanation!

    • @geekific
      @geekific  3 ปีที่แล้ว

      Thank you :) Glad you liked it!

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

    good refresher

  • @samz2004-4
    @samz2004-4 วันที่ผ่านมา

    Im confused about the open closed principle. In the example, it says we can extend the class by adding new earning calculator classes. but wouldnt we still need to add another enum to the original video class?

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

    Thank you❤

  • @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 11 หลายเดือนก่อน

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

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

    Great explanation!

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

    Super helpful

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

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

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

    Thanks sir, it's very clear

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

    7:20 wouldn't just be better if we could just create a base class that doesn't have playRandomAd methods and have both video and videoPremium class inherited it and implements playRandomAd inside video instead. Does that make sense? So we have the option to either override methods from base or not and also helps us reducing number of lines code.

    • @wegojimmy
      @wegojimmy 4 วันที่ผ่านมา

      i thought so too

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

    Does the Liskov principle always mean applying composition?

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

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

  • @Manuel-fp6ni
    @Manuel-fp6ni 6 หลายเดือนก่อน

    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

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

    very well made video!

  • @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 11 หลายเดือนก่อน

      i am d'accord@@geekific

  • @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 11 หลายเดือนก่อน

      thanks you@@geekific

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

  • @avatarsece
    @avatarsece 4 หลายเดือนก่อน +1

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

  • @1CProgrammer
    @1CProgrammer ปีที่แล้ว

    😂😭😁🤝