[Design Patterns in Javascript] The Strategy Design Pattern in Javascript

preview_player
Показать описание
The Strategy Design Pattern is used to allow to inject different algorithms into an object instead of having to keep all of the logic wrapped up inside of if statements. It also helps us to avoid using subclasses.

Want to move out of the beginner and intermediate programming levels into being more advanced? One of the things that will help get you there is learning design patterns.

This is the fourth episode in a new series we are doing on design patterns in javascript.

We are putting out 2+ videos per day, so subscribe to our channel if you want to seriously level up your development game. 👊 Helpful Links 👊

Free E-book:

Рекомендации по теме
Комментарии
Автор

Loved how you first created a problem and then solved it with the pattern.

ParthChokshi
Автор

Great example, really helped drive the point home - thanks for taking the time to record it.

uisnippets
Автор

Clear from the beginning to the end, thanks

VladimirJovana
Автор

how could we eliminate/avoid manually passing the Strategy class as parameter? 12:56

andreivedovato
Автор

Thanks for the explanation. A total noob question. :)
what if we extend the class to SalaryEmployee() and HourlyEmployee() and override the sendPayment() method? I mean sometimes in project and more complex code, I cant tell what to use.

neolee
Автор

So it is basically a smarter way to implement polymorphism

mervinmarias
welcome to shbcf.ru