OOP – When to support the inheritance of a combination

This question seems to be repetitive, but it is not the case. I searched on Google and the bus was unable to get conceptual clarity. There are many examples of animals and cars. However, I want to understand the basic logic
Generally speaking, composition is favored over inheritance because it provides many advantages. In this case, why inheritance is provided as one of the main concepts of OOP.
My question is when to support inheritance Better than composing?
Rather than change, maintainability, etc., I think the core concept is very important. In certain situations, the relationship seems to be more Does it matter better?

Recommended reading: Gang Of Four discusses Type, Interface, OOP, etc. before starting to discuss the mode.

Also take a look:
Composition vs. Inheritance: How to Choose?

This question seems to be repetitive, but it is not the case. I searched with Google and the bus cannot get the conceptual clarity. There are many examples of animals, cars. But , I want to understand the basic logic.
Generally speaking, composition is favored over inheritance because it provides many advantages. In this case, why inheritance is provided as one of the main concepts of OOP.
My The question is when is support for inheritance better than composition?

Rather than change, maintainability, etc., I think the core concepts are important. In certain situations, relationships seem to be better than having relationships?

Recommended reading: Gang Of Four discusses Type, Interface, OOP, etc. before starting to discuss the mode.

Also take a look:
Composition vs. Inheritance: How to Choose?

Leave a Comment

Your email address will not be published.