Skip to content

Indirection

Prime #
162
Origin domain
Computer Science & Software Engineering
Also from
Systems Thinking & Cybernetics, Statistics & Experimental Design
Aliases
Level of Indirection, Reference, Pointer Abstraction
Related primes
Abstraction, Virtualization, Interface, indirection overhead

Core Idea

Introducing an intermediate reference or layer to manage access or interaction, rather than direct coupling between components.

How would you explain it like I'm…

Going Through A Helper

Imagine you don't write your friend's house on every letter; you write 'Mom's friend Sam.' If Sam moves, Mom just remembers the new house, and your letters still get there. You point at Sam through Mom, not at Sam's house directly.

Pointing Through A Middleman

Indirection is when you don't talk to a thing directly — you go through a middle helper instead. Like saving a friend's number under a name in your phone: you tap the name, the phone looks up the number for you, and dials it. If your friend changes their number, you only update it once and everything keeps working. In computers, this trick lets people swap parts of a program without breaking all the other parts that use it.

Reference-Layer Decoupling

Indirection is the trick of putting a referencing layer between the thing that wants something and the thing that provides it, so that you reach the provider through the reference instead of grabbing it directly. The benefit is that the provider can move, change versions, get faster, or be swapped for a different one entirely, and the user code doesn't have to change — because it was only ever holding the reference. The classic line attributed to David Wheeler is, 'All problems in computer science can be solved by another level of indirection.' The costs are real too: indirection can slow things down, make debugging harder, and add cognitive load. The skill is knowing when the flexibility is worth those costs.

 

Indirection is the interposition of a referencing mechanism between a consumer and a provider (or between two collaborating components) such that the consumer accesses the provider through the reference rather than directly. The referencing mechanism may be a pointer, an identifier resolved through a lookup table, a virtual-function dispatch slot, a URL resolved through DNS, a service-discovery handle, or any analogous intermediary. The structural payoff is that the provider's identity, location, implementation, or instance can change without requiring the consumer to change, since the consumer is bound only to the reference. Indirection is the precondition for decoupling, late binding (resolving names at runtime instead of compile time), polymorphism, virtualization, and many other composition techniques. Costs include runtime overhead (the extra dereference), cognitive overhead (an additional thing to reason about), and debugging friction (longer call chains), but these are usually more than offset by the flexibility and maintainability gains when change or substitution is anticipated. Hardcoded direct coupling is preferred only when the binding is genuinely fixed.

Broad Use

  • Software: Pointers and references decouple data from its physical location in memory.

  • Networking: DNS (Domain Name System) translates human-friendly domain names to IP addresses.

  • Security: Proxy servers or VPNs as a layer between users and resources.

  • Management: Organizational hierarchies that buffer direct interaction between top-level leadership and frontline workers.

Clarity

Simplifies and hides complexity behind intermediate layers, ensuring flexible and maintainable connections.

Manages Complexity

Minimizes direct dependencies, allowing systems to evolve or reorganize without breaking everything upstream or downstream.

Abstract Reasoning

Encourages designing with layers and interfaces, focusing on behaviors rather than internal implementations.

Knowledge Transfer

Appears across communication protocols, management structures, and design patterns in various fields that require intermediate layers for abstraction or control.

Example

DNS in networking parallels how phone directories or administrative assistants mediate communication: you do not directly memorize everyone's address but use a system of references to reach the right endpoint.

Relationships to Other Primes

One-hop neighborhood: parents above, mutual partners to the right, children below.Indirectionsubsumption: LayeringLayeringcomposition: AbstractionAbstractionsubsumption: VirtualizationVirtualization

Parents (2) — more general patterns this builds on

  • Indirection is a kind of Layering — Indirection is a specific kind of layering, interposing a reference between consumer and provider to decouple them.
  • Indirection presupposes Abstraction — Indirection presupposes abstraction because interposing a referencing layer requires deciding which features of the provider to retain as the contract.

Children (1) — more specific cases that build on this

  • Virtualization is a kind of Indirection — Virtualization is a specialization of indirection in which the interposed reference simulates a dedicated underlying resource over a shared substrate.

Path to root: IndirectionLayering

Not to Be Confused With

  • Indirection is not Metaphor because indirection is a concrete mechanism—a reference and a resolution process—that decouples components, whereas metaphor is a conceptual mapping from a source domain to a target domain; metaphor enables understanding, indirection enables flexibility and substitutability.
  • Indirection is not Abstraction because abstraction is a conceptual activity of modeling a system with its essential features, whereas indirection is a concrete mechanism—a reference, name, or handle—that can support abstraction but exists independently; one can have abstraction without indirection (on paper), and indirection without explicit abstraction (a pointer that happens to enable substitution).
  • Indirection is not Modularity because modularity is the organization of a system into discrete, semi-independent units, whereas indirection is the mechanism enabling substitution and loose coupling between those units; indirection is a tool that can support modularity, but modules can be tightly interdependent without indirection.