Composite as Universal Abstraction

Humane Code, Episode 2

By Mark Seemann

37 minOct 2017

Composite as Universal Abstraction

How do you make code readable? How do you make code fit in your head? How do you create good abstractions? How do you amplify the essentials while eliminating the irrelevant?

One useful tool is to employ the Composite design pattern, but when can you apply it? When are objects composable?

There’s a simple answer to that question. In this episode, you’ll learn to tell at a glance whether an interface is composable or not. This will also set you on the path of being able to deliberately design APIs in such a way that they’re composable – that is: so that they are intuitively understandable abstractions.

Composite is a universal abstraction. It’s not tied to a particular programming language or specific development paradigm. Under a different name, it exists independently of software development. This makes it a powerful abstraction.