Last month Alistair began using a new name for the Hexagonal Architecture pattern – he now calls it the Ports and Adapters Architecture.
Now I believe that names are immensely important, and so I applaud Alistair’s search for the right name for this concept. But for some reason PortsAndAdapters rings no bells for me. Maybe I’ve simply become used to the old name, or maybe I’m averse to change. (That would be ironic for an agile coach, but I guess we all have comfort zones…) So what is it with this new name – or what does the old name have instead?
Obviously I have no quibble with the ‘Adapters’ part, because I’ve been using that term for long enough myself. But ‘Ports’? From that term I would tend to infer a fixed set of pre-existing conduits, sending and receiving signals from something specific. Whereas I tend to think of a hexagonal architecture as something much more flexible, able to post adapters (more on this soon) to a less prescribed set of real-world entities.
I tend to view the physical world as an amorphous soup to which the software system can connect adapters in fluid ways. I know that’s inherently impractical, but it makes for a great mental model when whiteboarding a system. And I think this gets near to the crux of my unease at the new name. I think of a hexagonal architecture as a whole-system view, whereas PortsAndAdapters seems to look only at the system’s connections with the physical world. The key, for me, is the symmetry, and the consequent removal of the constraints of the layered model. I don’t care about the Ports; I’m interested instead in the central core where the knowledge lives, and the ability to interact with that core in flexible ways. To me, hexagonal architecture is all about inner and outer, core and periphery, business knowledge and interfaces.
Why so much about just a name? After all, it’s clear that neither name comes close to expressing the above…