Open Closed Principle - Real world example with Factory and Strategy patterns | SOLID
Автор: Kcode
Загружено: 2025-08-11
Просмотров: 224
🔔 SUBSCRIBE for more content like this 👇:
/ @kcode_tech
-------
In this video, we explore how to replace long switch or if/else statements with Dependency Injection (DI) to write cleaner, more maintainable code.
You’ll learn:
✅ Why functions with switch(if/else) statements can violate the Open/Closed Principle (OCP)
✅ How to refactor to use Factories with Strategy patterns
✅ How to dynamically register behaviors without touching core logic
✅ The difference between the bad approach (modifying existing code) and the good approach (extending)
By the end, you’ll know how to design code that’s flexible, testable, and future-proof — and you’ll see a real-world example with tax and pricing policies.
-------
📱 Social media links:
Twitch: / kcode_tech
🔗 Useful Links:
GitHub Repository: https://github.com/k-code-yt/nestjs-s...
#kcode_tech #kcode #solid #nodejs #nestjs
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: