Skip to main content

Ports

The domain speaks through ports, never directly to infrastructure.

Ports are interfaces — they declare what the domain needs without specifying how. Driving ports accept commands from the outside. Driven ports request services from the outside. The domain owns both.

Context

Questions

How do you know when a port interface is at the right level of abstraction?

  • What breaks when a port leaks infrastructure concerns into the domain?
  • When should a single port split into multiple narrower interfaces?