Get the latest tech news

When did people favor composition over inheritance?


The phrase “favor composition over inheritance” has become one of those thought-terminating cliches in software design, and I always like to take a deeper look at those to understand where they come from and what ideas we’re missing if we just take the phrase at face value without engaging with the discussion that led to it. This is one of those aphorisms with a definite origin story (compare with Aphorism Considered Harmful for an example where the parts have clear origins but the whole does not): it’s the second object-oriented design principle in the Design Patterns book from the “Gang of Four” Gamma, Helm, Johnson, and Vlissides.

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of people

people

Photo of inheritance

inheritance

Photo of composition

composition

Related news:

News photo

Somalia e-visa breach: US warns thousands of people's data exposed

News photo

Why this year-old Android smartwatch is still a prime option for most people (and it looks great)

News photo

Five People Plead Quilty To Helping North Koreans Infiltrate US Companies