Hexagonal architecture: the orders module

Keep the business rules in a core that declares ports, and plug HTTP, storage and providers in as adapters.

Level Intermediate

What you will see

  1. Rules that only HTTP can reach
  2. A domain that knows nothing of HTTP
  3. Ports: what the core offers and what it needs
  4. Adapters translate at the edge
  5. One place to plug everything in
  6. When the hexagon is too much

Before / after

Base: naive-crud-goView the diff

Exercises