Skip to main content
Question

Hexagonal Architecture

  • September 20, 2023
  • 4 replies
  • 101 views

alistair_cockburn

Why is there a "hexagon"? Why the 6 sides? And how important is it?

4 replies

Forum|alt.badge.img+3
  • Specialist
  • 69 replies
  • September 21, 2023

It was invented by a guy named “Alistair Cockburn” funnily enough :cD


hungoboss
Forum|alt.badge.img+3
  • Specialist
  • 71 replies
  • September 21, 2023

Honestly, I’d say that you should probably ask a guy named Alistair Cockburn for the answer. :)

The “hexagon” in this case is not to represent the six slides (in fact, it could have been the octagone as well), but having a hexagon instead of a square allows the people to draw the ports and adapters as they need. No longer are they limited to one-dimensional drawings, as the adapters and ports can be drawn under the angle.


  • Ensign
  • 1 reply
  • September 21, 2023

A hexagon because it wants to break with the classic asymmetric drawing of a rectangle, where the flow goes "top to bottom" or "left to right". On the other hand, the hexagon remarks the symmetry on all sides, i.e. it highlights the inside/outside distinction, instead of the top/bottom or the left/right. The chosen polygon was a hexagon because it is easier to draw than others (pentagon, heptagon, ...)

The number of sides (6) isn't important, the important thing is what a side means. Each side represents a "port", which is define by the inside (the app) for interacting with the outside. Ports protect our app from the rest of the world.

 


  • Ensign
  • 1 reply
  • September 24, 2023

The hexagon itself is not important in hexagonal architecture. What is important is the ports and adapters, which form nice interfaces to the business logic, and like Lego bricks can be connected to create different structures. The hexagon is simply a way of communicating the architecture.


Reply