October 25, 2016
20,011
309
56
1.82%
Every word spoken in this episode is indexed. Type any phrase to jump straight to the moment it was said.
Type any word or phrase that may have been spoken. Click a result to seek the player to that exact moment.
Try a name, a topic, or a quoted line
See what was published immediately before and after this episode.
21:42Now Playing👉🏻 Check Out The NEW Simple Programmer YouTube Channel With NEW Programming Videos:
SUPPORT THIS YOUTUBE CHANNEL: vid.io/xokw
Composition Vs. Inheritance: How To Choose?
Today we are going to talk about real programming.
Composition Vs. Inheritance. Have you ever heard about these terms? How should you choose between these two terms?
One of the advantages of Object-Oriented programming language is code reuse. There are two ways we can do code reuse either by implementation of inheritance (IS-A relationship), or object composition (HAS-A relationship). Although the compiler and Java virtual machine (JVM) will do a lot of work for you when you use inheritance, you can also get at the functionality of inheritance when you use composition.
As you all know, Inheritance is fundamental to object-oriented programming. A programming language may have objects and messages, but without inheritance, it is not object-oriented (merely "object-based", but still polymorphic).
Composition is also fundamental to every language. Even if the language does not support composition (rare these days!), humans still think in terms of parts and components. It would be impossible to break down complex problems into modular solutions without composition.
So, how can you possibly know what is the best? How to choose between composition and inheritance? Watch this video and find out!
If you have a question, email me at john@simpleprogrammer.com
If you liked this video, share, like and, of course, subscribe!
Subscribe To My YouTube Channel
Visit Simple Programmer Website
Connect with me on social media:
Other Links:
Sign up for the Simple Programmer Newsletter
Simple Programmer blog
Learn how to learn anything quickly
Boost your career now
Sentinel Indexing in Progress
Metadata and chapters are available. Claim extraction for this episode is pending.
All video content is delivered via YouTube embedded players in accordance with the YouTube Terms of Service. Sentinel provides research tools that promote discovery and accountability across political media.