jargon

Comparison

ComposabilityvsComposition over inheritance

Composability

the new feature was two things you already had, wired together, and nothing new was written.

The property that small pieces can be combined into larger ones without special cases. Composable parts have uniform inputs and outputs and no hidden state, which is what lets them be assembled in orders nobody anticipated. It is worth naming in a review because it is the difference between a system that grows by adding a piece and one that grows by editing the middle of everything that exists.

Full entry →

Composition over inheritance

the subclass needed one method overridden and inherited four others it never wanted and cannot remove.

Preferring to build behaviour by combining objects rather than by extending a base class. Inheritance couples you to everything the parent does now and everything it will do later, and it is a decision you make once at compile time; composition is a decision you can change per instance. The argument comes up whenever a class hierarchy has grown a third level, which is usually where the abstraction that justified the first level stops being true.

Full entry →

Related comparisons