Solving A Common Issue With The Strategy Pattern // In Python

Опубликовано: 20 October 2024
на канале: ArjanCodes
47,538
1.9k

💡 Learn how to design great software in 7 steps: https://arjan.codes/designguide.

If your strategy pattern relies on parameters, what's the right place set them? In this video, I show you three ways of doing this and what their effect is on the design of your software.

The code I worked on in this example is available here: https://github.com/ArjanCodes/2021-st....

🎓 ArjanCodes Courses: https://www.arjancodes.com/courses/

🔖 Chapters:
0:00 Intro
0:58 Explaining the example
3:34 Analysis of the example
4:40 Solution #1: keyword args
7:02 Solution #2: parameters class
10:47 Solution #3: strategy class initializer
13:56 Final thoughts

#arjancodes #softwaredesign #python