ELI5: Explain Like I'm 5

Composition over inheritance

Composition over inheritance is a way of creating computer programs and designs by putting together small pieces instead of getting all of your features from one big group.

Think of it like building a Lego tower. You could get a large tower piece to build your tower, but it might not be the exact shape you want. Instead, you can build your tower by using many small pieces, each of which do one simple thing. This method will give you exactly what you want!

In computer programming and design, composition over inheritance is the same idea. When you use inheritance, you get all of your features from one big group. But when you use composition, you have more control over your design because you can choose the small pieces to make it just the way you want.