Cohesive Systems logoCOHESIVE SYSTEMS

Ports and Adapters

Ports and Adapters addresses the problem of keeping domain and application semantics independent from specific infrastructure, protocols, user interfaces, and external systems.

Cohesive Formulation

Ports define interaction boundaries. Adapters are realization mechanisms that translate between substrate-specific messages and Cohesive concepts such as commands, queries, observations, events, and interactions.

The practice asks:

  • Which boundary is being crossed?
  • What semantic object enters or leaves the boundary?
  • Which observer interprets the input?
  • What protocol, storage, UI, or external system realizes the edge?

In the Model

An inbound adapter turns an external occurrence into an input event, command, or query relative to an observer. An outbound adapter turns an endogenous event, query, command, or observation into a protocol-specific effect.

Failure Modes

The pattern fails when adapters leak substrate semantics into the domain, or when ports are treated as technical interfaces without stating the semantic boundary and authority they represent.

Related concepts: boundaries, observer, command, query, observation, event, interaction, network, application hosts, realization, anti-corruption layer.