QUESTIONABLE Object Creation Patterns in Python 🤔

Опубликовано: 30 Апрель 2021
на канале: ArjanCodes
71,629
2.3k

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

Sometimes it's good to talk about what not to do when designing software. In this video, I talk about the singleton and object pool patterns, both of which are object creation design patterns. I'll show you how they work in Python and discuss why the singleton pattern in particular is something you shouldn't use. The object pool can be considered a generalization of the singleton pattern, and it has its uses, but it has a few caveats.

About singletons in Python: https://stackoverflow.com/questions/6...

You can find the code I worked on in this episode in my GitHub repository: https://github.com/arjancodes/betterp...

🔖 Chapters:
0:00 Intro
0:28 Design pattern categories
1:14 The singleton
2:42 Singleton code example
5:38 Why singletons are an anti-pattern
6:47 The object pool
7:33 Object pool code example
11:34 Object pool with context manager
13:20 Limitations and caveats of the object pool
14:32 Gag reel

#arjancodes #softwaredesign #singleton


На этой странице сайта вы можете посмотреть видео онлайн QUESTIONABLE Object Creation Patterns in Python 🤔 длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь ArjanCodes 30 Апрель 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 71,629 раз и оно понравилось 2.3 тысяч зрителям. Приятного просмотра!