Strategy Design Pattern | NetFlix Video Player | Object Oriented Design Pattern Interview Question

Поділитися
Вставка
  • Опубліковано 5 вер 2024
  • Strategy Design pattern is a behavioral design pattern which is one of the most commonly used design pattern as it helps with implementation of run time polymorphism and adheres to the SOLID principle which says segregate responsibility of the class.
    In this video i have explained it with the help of Netflix Video player which plays video on various devices in various resolutions
    You can buy us a coffee at : www.buymeacoff...
    system design: • System Design | Distri...
    DS for beginners: • Arrays Data Structures...
    leetcode solutions: • Leetcode 84 | Largest ...
    github: github.com/The...
    facebook group : / 741317603336313
    twitter: / granthtech

КОМЕНТАРІ • 24

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

    Thanks again
    question: is it necessary to create TVVideoplayer or PhonePlayer class?
    Isn't it ok to create videoplayer like you did as a concrete class and then pass the appropriate Device and Resolution objects to it. Just pass what devide and resolution we want directly to Videoplayer. Why need to create concrete TVVideoPlayer class and then pass TV device to it?. lly PhonePlayer and then pass Phone devide to it?

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

    Hey, I am big fan. Please continue creating new videos and big thanks

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

      Yes sure, will come up with new videos soon 🙂 Do like and subscribe and share with others 🙂

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

    Thanks for the video..loved it

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

      Gald it was helpful. Do like and subscribe and share with others 🙂

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

    keep uploading good bro

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

      Do like and subscribe and share with others 🙂

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

    Why is strategy pattern preferred against bridge pattern in this case? Could we have used bridge pattern as well?

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

    Thanks for the video, Btw, Do we really need the VideoPlayer class to be an abstract class? Because in the implemented classes (TVVideoPlayer and PhoneVideoPlayer) display() method is same. So why it needs to be an abstract method. We could have a concrete display method in VideoPlayer class and make it as concrete class. In constructor of VideoPlayer class we may inject Device and Resolution. So TVVideoPlayer and PhoneVideoPlayer is not at all needed right?

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

      Why constructor, we can use setters and use the same video player object. This way suppose we have 5 devices which supports 5 resolutions. We need to create 25 objects. Waste of memory. We create 1 concrete class video player and use setters to interchange the device and resolution. EVERYTHING DONE USING 1 OBJECT

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

    thanks for video.

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

      Glad it was helpful. Do like and subscribe and share with others 🙂

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

    Shouldn't the TVVideoPlayer and PhoneVideoPlayer constructor have their corresponding device types in them like TV and Phone ? If not VideoPlayer class's constructor could have done the job?

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

    Sir make a video on charting website like tradingview system design.....

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

      Sure will add this, currently little occupied with my work so not able to upload, will will try to upload soon

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

    Why do we need strategy design pattern if we can directly use run time polymorphism

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

      in hind sight you were already using this pattern, didn't you :)

  • @kunalsharma-zc2ho
    @kunalsharma-zc2ho 2 роки тому +1

    please create more video on Design patterns

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

      Have covered the important ones, will come up with more in future.
      Do like and subscribe and share with others 🙂

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

    I didnt get that why do we need TVVideoPlayer and PhonePlayer classes. There isnt any specific things inside those so can't we use a general class for them i.e. VideoPlayer itself? So I dont think VideoPlayer has to be abstract for that reason.

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

    Hi Thank You for the Videos it help full is there any chance of you can explain the Low Level Design in Python please.

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

      For now the plan is for java. Please try to understand the concept and implement. Do share.the code in comment I will pin it and we can have reviews

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

    in startegy we have context. here there are multipile context. is my understanding right

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

      Basically we have multiple algorithm performing some jobs and we need to pick one at runtime