Add a comment


Re: Layers, hexagons, features and components

Hello Juan,

While I was preparing a live-coding session with Alistair Cockburn about his pattern, I realized that I didn't grasp correctly the notion of Port and Adapter so far.

A Port is what represent the intention of going-in/going-out the hexagon. In C# it is an interface which is part of the Domain. BTW, Ports are always part of the Domain side.

An Adapter is whatever is needed to go-in/go-out the hexagon at runtime. It gathers things you code (i.e: mapping between infra<->domain data models) but also things you don't code (like your favorite http stack for instance). Adapters are always part of the Infrastructure side

Now regarding the pattern name. An onion has much more than 2 layers in general ;-) This is why I dislike it as a pattern. I'd prefer having 2 layers only: Domain and Infrastructure, so that we can keep being focused on the Domain problem without being lost in our tech talent to multiply the number of Layers (what I see everywhere).

To clarify more the implemention, I suggest you have a look at our recent live-coding session with Alistair:

Part1 (Alistair only):

Part2 (Alistair and me doing the live-coding):

Part3 (end of our live-coding session + Q&A with Romeu Moura):

Re: Layers, hexagons, features and components

HTML : b, strong, i, em, blockquote, br, p, pre, a href="", ul, ol, li, sub, sup
E-mail address
Remember me Yes  No 

E-mail addresses are not publicly displayed, so please only leave your e-mail address if you would like to be notified when new comments are added to this blog entry (you can opt-out later).