MENU

Fun & Interesting

The Only Time You Should Use Polymorphism

Christopher Okhravi 97,656 12 months ago
Video Not Working? Fix It Now

The only time you should use subtype polymorphism is when you have behavioural variation in the subtypes. I teach two university courses on object oriented programming and I see this problem a lot. Let me explain. 💚 BUY MY BOOK: https://leanpub.com/the-object-oriented-way/ RECOMMENDED READING: 🛠️ https://geni.us/k8KhT3 (Refactoring) ⭐️ https://geni.us/zzlx (Dependency Injection: Principles, Practices, and Patterns) 💎 https://geni.us/hNDE (Elegant Objects) 🏛️ https://geni.us/IBhtLnh (Clean Architecture) 🧩 https://geni.us/nlbA6 (Head First: Design Patterns) Read my FREE book on Object Oriented Programming: 🚀 https://theobjectorientedway.com Watch next: https://youtu.be/TkUhAbbRCAE CONTENTS: 00:00 Thesis 01:16 Example 1 03:28 Example 2 06:25 Example 3 13:26 Summary

Comment