Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 
avatar of Matthieu H

Matthieu H

Matthieu H has asked 0 questions and find answers to 1 problems.

Stats

25
EtPoint
8
Vote count
0
questions
1
answers

About

Composition over inheritance is overthinking, use inheritance only when it makes sense and use composition only when it makes sense:

  • Think of composition as a has a relationship. A car "has an" engine, a person "has a" name, etc.

  • Think of inheritance as an is a relationship. A car "is a" vehicle, a person "is a" mammal, etc.