Skip to content

Instantly share code, notes, and snippets.

@jmewes

jmewes/notes.md Secret

Created October 26, 2017 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmewes/32c166db8d66e144a812aac1a2cf47d7 to your computer and use it in GitHub Desktop.
Save jmewes/32c166db8d66e144a812aac1a2cf47d7 to your computer and use it in GitHub Desktop.
Hexagonal architecture -- Alistair Cockburn

http://alistair.cockburn.us/Hexagonal+architecture

  • 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