solid-principlesdependency-inversion.mdSettings
solid-principles, updated 30 Jul 2026

Dependency Inversion: The Hive Does Not Know the Field

Placeholder prose. The hive decides what to collect; the field decides what is on offer. Neither imports the other. The opening section sets up the analogy and states the principle in one sentence.

Second paragraph of placeholder body copy. It names the failure mode the principle prevents and the test that suddenly needs a database.

The import that goes the wrong way

Placeholder lead-in to the code sample below.

hive/policy.ts
import { PostgresNectarStore } from "../infra/postgres";

class ForagingPolicy {
  // policy now depends on a driver
  private store = new PostgresNectarStore();
}

The direction of a dependency is a design decision, not a fact about the code.

Both arrows point inward

Closing placeholder paragraph. It restates the rule, concedes the one case where breaking it is fine, and hands off to the next article.