✎ Text Section 3 of 6

The shape

Keep business logic in the core; point infrastructure inward.

That separation has a standard shape. Picture the system as three regions:

  • A core in the middle, holding the business logic and nothing else — no database, no HTTP, no email. Just the rules and the language of your domain.
  • Primary adapters on one side: the things that drive the core. An HTTP controller, a CLI, a message consumer, a test. They translate the outside world’s requests into calls on the core.
  • Secondary adapters on the other side: the things the core drives. A database, an email service, a payment gateway. The core defines what it needs; these provide how.

[ILLUSTRATION: the classic hexagon — core in the centre, primary adapters feeding in from the left, secondary adapters hanging off the right. Label the core “where your intent lives.” Keep it clean; this is the one diagram learners will carry in their heads.]

You may know this as hexagonal architecture, or ports and adapters. The name doesn’t matter and the dogma around it matters even less. What matters is the one move it encodes: the core depends on nothing; everything depends on the core. Infrastructure points inward.