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
In questa pagina del sito puoi guardare il video online Master Strategy Design Pattern Like a PRO in No Time della durata di ore minuti seconda in buona qualità , che l'utente ha caricato codevev 01 febbraio 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,655 volte e gli è piaciuto 37 spettatori. Buona visione!