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
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?
Hey, I am big fan. Please continue creating new videos and big thanks
Yes sure, will come up with new videos soon 🙂 Do like and subscribe and share with others 🙂
Thanks for the video..loved it
Gald it was helpful. Do like and subscribe and share with others 🙂
keep uploading good bro
Do like and subscribe and share with others 🙂
Why is strategy pattern preferred against bridge pattern in this case? Could we have used bridge pattern as well?
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?
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
thanks for video.
Glad it was helpful. Do like and subscribe and share with others 🙂
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?
Sir make a video on charting website like tradingview system design.....
Sure will add this, currently little occupied with my work so not able to upload, will will try to upload soon
Why do we need strategy design pattern if we can directly use run time polymorphism
in hind sight you were already using this pattern, didn't you :)
please create more video on Design patterns
Have covered the important ones, will come up with more in future.
Do like and subscribe and share with others 🙂
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.
Hi Thank You for the Videos it help full is there any chance of you can explain the Low Level Design in Python please.
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
in startegy we have context. here there are multipile context. is my understanding right
Basically we have multiple algorithm performing some jobs and we need to pick one at runtime