Strategy Pattern may seem a bit like the State pattern but the difference is in the intent. With the State pattern, we wanted to represent the object in different states without necessarily changing the object itself. With the Strategy Design Pattern, we are after changing the object's behavior.
So as you may have guessed, what we're trying to accomplish is to have certain functions execute a different path, depending on our needs.
The concept remains very similar to what it was in the state pattern. But instead of the implementations of the State interface, we're passing in the implementations of the behavioral, or Strategy interfaces.
You don't need to watch a 45-minute video to grasp and implement this concept. Just watch these two minutes and become more familiar with how you can implement the strategy pattern in Python.
#Python #DesignPatterns #StrategyPattern
-------------------------------------------------------------------------------------
📰 Sign up for my newsletter
Become a better dev in just 5 minutes (or so) a week: https://codevev.com
☕*Buy me a coffee*
You can express your support by buying me a coffee at https://buymeacoffee.com/codevev
🖥️ Free Courses to Learn Programming
Harvard CS 50: https://pll.harvard.edu/course/cs50-i...
FreeCodeCamp: https://www.freecodecamp.org
Udacity: https://www.udacity.com
🛒 Products I recommend
https://codevev.com/#products
Connect with me
Website: https://evgenyurubkov.com
Youtube: / @codevev
#codevev
Nesta página do site você pode assistir ao vídeo on-line Master Strategy Design Pattern Like a PRO in No Time duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário codevev 01 Fevereiro 2022, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 1,655 vezes e gostou 37 espectadores. Boa visualização!