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
En esta página del sitio puede ver el video en línea Master Strategy Design Pattern Like a PRO in No Time de Duración hora minuto segunda en buena calidad , que subió el usuario codevev 01 febrero 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,655 veces y le gustó 37 a los espectadores. Disfruta viendo!