🏗️Hexagonal Architecture
Also known as Ports and Adapters, Ports and Adapters Architecture
Keeping an app's core apart. It links to the outside through ports and adapters.
Think of it like
Think of it like a phone with a charging port. Any charger that fits the port will work.
Example
Jack's core has a port for sending messages. In tests he plugs in an adapter that just records them. In production a real email adapter sends them.
Why it matters
The core can be tested with no database or network at all. That makes tests fast and steady.
Definition
Common mistake
Key takeaways
- 1Core in the middle. Knows no outside tools.
- 2Ports are needs. Simple interfaces.
- 3Adapters plug in. Real or test.