Skip to content

Instantly share code, notes, and snippets.

@jmewes jmewes/ Secret
Created Oct 26, 2017

What would you like to do?
Hexagonal architecture -- Alistair Cockburn

  • aka. Ports & Adapters

  • allows an application to be controlled by different input source, e.g. users, scripts, and automated tests

  • creates a new layer without business logic

  • every piece of functionality is offered via an API

  • "the application communicates over ‘’ports’’ to external agencies."

  • port ~ generic interface; adapter ~ specific implementation

  • The the port is injected into the application e.g. via the constructor

Related pattern

  • Factory Pattern (=> GoF)
  • Adapter Pattern (=> GoF)
  • Dependency injection (=> Martin Fowler)
  • Inversion of Control (=> Robert Martin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.