Composition over Inheritance [Object Oriented Programming]

Поделиться
HTML-код
  • Опубликовано: 26 окт 2024

Комментарии • 47

  • @kininthenorth
    @kininthenorth Год назад +2

    This was a great explanation on Composition vs Inheritence. TLDR for others: IS A vs HAS A. If both applies, go for Composition (HAS A)
    One small issue with the video: What is a that duck/wheezing noise in the background? lol. It was a tad bit distracting in the beginning, but not a big deal overall.

    • @jawahar.nutshell
      @jawahar.nutshell  Год назад

      Thanks for your feedback. 💡
      The noise, I am not sure. May be it’s the air conditioner. 😜 Hope it didn’t impact the experience.

  • @vishwai8653
    @vishwai8653 Месяц назад

    First time watched this video from this channel, subscribed immediately. Great explanation.

  • @manasmangalpattanaik3539
    @manasmangalpattanaik3539 2 года назад +1

    Candid explanation. Nice one!

  • @NabeelAssain
    @NabeelAssain 7 месяцев назад +1

    Excellent explanation! Simple and clear

  • @parmeshwarkothakonda455
    @parmeshwarkothakonda455 Год назад +1

    Clear and simple Explanation, Thank you :)

  • @mariyajoshkatteboina8749
    @mariyajoshkatteboina8749 Год назад +1

    wow! great explanation.Thank you!

  • @rethanvit
    @rethanvit 9 месяцев назад +1

    Simple, yet clear. Thank you!

  • @sujayghosh5128
    @sujayghosh5128 Год назад +1

    Great Video. Highly appreciated

  • @snppus
    @snppus Год назад +1

    nice explanation

  • @DeependraJoshi-y5u
    @DeependraJoshi-y5u Год назад +1

    Beautiful and simple understandable example you explained, thank you. Thank You!

  • @gowthamkarukola2803
    @gowthamkarukola2803 2 месяца назад

    excellent explanation

  • @alex323200
    @alex323200 2 года назад +1

    Well done mate!

  • @anirbanmanna2897
    @anirbanmanna2897 2 года назад +1

    Great video in simple logic

  • @meshu_amare
    @meshu_amare Год назад +1

    you gave me very clear insight into inheritance and composition. Thanks a lot sir.

  • @rajsaraogi
    @rajsaraogi Год назад +1

    The best point was regarding dependency injection and how composition helps via constructor to dynamically resolve dependencies

  • @mquintem
    @mquintem 2 года назад +2

    as usual, on point, great video

  • @أميرالمؤمنينبنمحمدأكرم

    You explain it greatly.
    I got the picture now

  • @mukulmangla632
    @mukulmangla632 2 года назад +2

    Nice Explanation !

  • @MrKumaranraj
    @MrKumaranraj 2 года назад +1

    Thanks for the detailed explanation, expecting more video like this

  • @barisselayet
    @barisselayet 2 года назад +1

    Thank you. This video is so helpful. Keep up the good work.

  • @jishajoy8201
    @jishajoy8201 2 года назад +1

    This video is really helpful.. expecting more like this

  • @achyuthapreksha5028
    @achyuthapreksha5028 5 месяцев назад

    excellent

  • @a_utopian
    @a_utopian Год назад +1

    🔥🔥🔥

  • @surajshenmare3144
    @surajshenmare3144 2 года назад +1

    Great explanation. Please complete Object-Oriented Programming Series.

  • @michaelgnanapragasam3125
    @michaelgnanapragasam3125 2 года назад +1

    Good

  • @mariyajoshkatteboina8749
    @mariyajoshkatteboina8749 Год назад +1

    Could you please create a playlist of solid principles and design patterns?It will be so helpful.

    • @jawahar.nutshell
      @jawahar.nutshell  Год назад

      Sure. Will consider doing it. Thanks for watching Nutshell 💡

  • @pavanraju4723
    @pavanraju4723 Год назад

    Hi @NutshellJawahar Sir, Could you please provide an example which cannot be done by composition over the inheritance ?..... I think whatever we can achieve via inheritance can be done by composition right?

  • @meshu_amare
    @meshu_amare Год назад

    But my question from the example is when we use composition you said the rule of encapsulation is keeping, but we can access eat functionality using flyable object just like f.fly() we can also call f.eat(). Maybe I misunderstood your explanation can you give me a context, please? about this

  • @cipherxen2
    @cipherxen2 10 месяцев назад +1

    You are designing inheritance wrong if you find composition better than it. Like in this example 'Flyable' has nothing to do with 'eat' functionality.
    Inheritance and composition are two very different tools. You've to use them wisely.
    In a good design, building blocks are created using inheritance and then, the business logic is built using composition of those building blocks.

  • @gaureesha9840
    @gaureesha9840 2 года назад +1

    Great explanation, thanks!

  • @pulkitgupta8310
    @pulkitgupta8310 2 года назад +1

    great explanation