Only Use Inheritance If You Want Both of These

Only Use Inheritance If You Want Both of These

25.618 Lượt nghe
Only Use Inheritance If You Want Both of These
Inheritance gives us hierarchical reuse of code AND subtype polymorphism. In this video I argue that we should only ever use it if we want BOTH. 💚 BUY MY BOOK: https://leanpub.com/the-object-oriented-way/ https://patreon.com/christopherokhravi 📚 Recommended Reading: https://geni.us/nlbA6 (Head First: Design Patterns) https://geni.us/PsXmo (Design Patterns: Elements of Reusable Object-Oriented Software) Watch next: https://youtu.be/YaSMkzmc_sA https://youtu.be/TkUhAbbRCAE https://youtu.be/SeN1s65tRHY 00:00 Intro 00:21 Only Hierarchical Reuse 03:16 Only Subtype Polymorphism 05:37 Avoid Inheritance? 07:13 Couple To Abstractions 07:32 Example 08:36 Conclusion