← all posts

2023-03-20

The Wouters Pyramid of Code Reuse

A framework for thinking about code reuse across four levels: in-app, intra-division, inter-company, and open source. The higher you go, the lower your maintenance cost.

Wouters Pyramid of Code Reuse

In March 2023 I sketched out a framework I'd been thinking about for a while. I called it the Wouters Pyramid of Code Reuse. It tries to answer a simple question: where should your code live, and why does it matter?

The pyramid

The pyramid has four levels, from bottom to top:

  1. In-app reuse - modular internals within a single application
  2. Intra-division reuse - a shared client module repository across projects in a team or division
  3. Inter-company reuse - public libraries and SDKs shared across organisations
  4. Open source - Drupal core, contrib modules, publicly maintained packages

The higher up the pyramid your code lives, the more people share the maintenance burden. And that directly reduces cost.

The cost equation

More reuse means:

This is not a new insight in isolation. But the pyramid makes it visual: every level you move up, you distribute the cost of keeping that code alive across a wider group of people.

The openness axis

The framework has a second dimension: openness. Each level of the pyramid corresponds to an API boundary:

The Openness axis: from function API to Standardised Public API

In a Drupal context: Drupal core and contrib sit at the top. The Dropsolid platform sits at the inter-company level. Client-specific modules sit lower. Application internals are at the base.

Monolith vs microservices: the wrong question

The pyramid also challenges the monolith vs microservices debate. The question isn't the architecture pattern, it's the reusability of the components:

Reusability is the variable that matters. Architecture is secondary.

Monolith of reusable components vs Microservice Mesh of not reusable components - cost comparison

Monolith of NOT reusable components vs Microservice Mesh of reusable components - cost comparison

Why I drew this

At Dropsolid we think a lot about where code should live. Should something be in Drupal core? In contrib? In our platform? In a client repo? The pyramid gives a simple answer: push code as high up as you can justify. The higher it goes, the more the cost of maintaining it gets distributed, and the more value you extract from the investment.

It's also a useful conversation tool with clients and teams. "Where does this belong in the pyramid?" cuts through a lot of architecture debates quickly.

Frederik Wouters Frederik Wouters · frederikwouters.be
Published: 2023-03-20 09:00 Updated: 2026-04-19 19:53