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
Auf dieser Seite können Sie das Online-Video Master Strategy Design Pattern Like a PRO in No Time mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer codevev 01 Februar 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,655 Mal angesehen und es wurde von 37 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!