Загрузка страницы

Observer Pattern Tutorial: I NEVER knew events were THIS powerful 🚀

This tutorial on the observer pattern is the fourth part of my series on how to write better Python code, I show you how to use events to write code that's really easy to change and extend. Events are a variant of the observer / listener design pattern. This video is inspired by a real-life example I recently encountered, where implementing an event-based approach provided a great solution to a design problem I had. Next to showing how to use events in your code, you'll also see what the effect is on the cohesion and coupling of the functions you write.

All parts in this series:
Part 1: Cohesion and coupling - https://youtu.be/eiDyK_ofPPM
Part 2: Dependency inversion - https://youtu.be/Kv5jhbSkqLE
Part 3: The strategy pattern - https://youtu.be/WQ8bNdxREHU
Part 4: The observer pattern - https://youtu.be/oNalXg67XEE
Part 5: Unit testing and code coverage - https://youtu.be/jmP3fp_BhmE
Part 6: Template method and bridge - https://youtu.be/t0mCrXHsLbI
Part 7: Exception handling - https://youtu.be/ZsvftkbbrR0
Part 7b: Monadic error handling - https://youtu.be/J-HWmoTKhC8
Part 8: Software architecture - https://youtu.be/ihtIcGkTFBU
Part 9: SOLID principles - https://youtu.be/pTB30aXS77U
Part 10: Object creation patterns - https://youtu.be/Rm4JP7JfsKY

Relevant books:
- Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides: https://amzn.to/3jllgyH
- Principles of Package Design: Creating Reusable Software Components by Matthias Noback: https://amzn.to/2NETK3l
- Clean Code: A Handbook of Agile Software Craftsmanship by Robert Martin: https://amzn.to/3qVZgNs
- The original Design Principles and Design Patterns article by Robert Martin: https://fi.ort.edu.uy/innovaportal/file/2032/1/design_principles.pdf

✅ Write cleaner code with Sourcery: https://sourcery.ai/?utm_source=YouTube&utm_medium=aff&utm_campaign=ArjanCodes

My software development setup:
💻 Apple M1 Macbook Air: https://amzn.to/3fq9nG5
⌨ Keychron K2 mechanical keyboard (awesome typing experience): https://amzn.to/3f1dlEI

My camera gear:
📷 Sony A7C - https://amzn.to/3aShCtw
🎙 Rode Wireless GO - https://amzn.to/3pSLFVU
🎙 Electrovoice RE20 - https://amzn.to/3xQAJ0w
🎙 Sennheiser MKH416 P48 - https://amzn.to/3vOpx2i
🎚 Sound Devices Mix-Pre 3 II - https://amzn.to/3nSOc37
💡 GVM RGB LED light - https://amzn.to/3qRNJid
💡 GVM 100W light with lantern softbox - https://amzn.to/2NuU8lk

☕If you want to support this channel, you can buy me a coffee here: https://www.buymeacoffee.com/arjancodes.

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

🔖 Chapters:
0:00 Intro
1:24 Explaining the code example
3:16 Analysis
4:45 Creating a simple event handler
7:19 Moving to an event-based approach
10:40 The complete solution
12:44 The power of an event-based system
14:12 Final thoughts

👍 If you enjoyed this content, give this video a like. If you want to watch more of my upcoming videos, consider subscribing to my channel!

DISCLAIMER - The links in this description might be affiliate links. If you purchase a product or service through one of those links, I may receive a small commission. There is no additional charge to you. Thanks for supporting my channel so I can continue to provide you with free content each week!

Видео Observer Pattern Tutorial: I NEVER knew events were THIS powerful 🚀 канала ArjanCodes
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
19 февраля 2021 г. 11:00:08
00:15:17
Яндекс.Метрика