Java: Composition over inheritance

preview_player
Показать описание
In this episode I talk about why composition is preferred to inheritance and how I got to understand this.
What signs I saw that inheritance was starting to turn against.
I also talk a bit about the Liskov substitution.

This video is part of my Clean Code course.
You can watch the Clean Code courses here:

Рекомендации по теме
Комментарии
Автор

Just here to say thank you for posting this. I see that it's been 3 years but this was incredibly helpful when preparing for my midterm

Alphunter
Автор

Holy this is a prime example of a diamond in the rough.
Clearest explanation of composition I have ever seen - starting with the binary inheritance/composition comparison at the start and finishing with the car example. Even explaining it in this comment forces me to be less clear. I loved how you brought in your own experience with the flaws of inheritance and how that naturally leads to: always use composition.
Thank you so much!

Oculux
Автор

Man, you are genius, describing the whole principle in one line, car should has a horn and a steering wheel, instead of being them. <3

hedi_muhammad
Автор

I felt robbed by the fact that this video ended suddenly at the best part 😂

igor
join shbcf.ru