Building beautiful systems with Phoenix contexts and Domain-Driven Design
Phoenix contexts are a powerful code organization tool - but without a clear idea of what business domains live under the hood of your systems, naively creating contexts leads to over-engineered, fragile systems.
Today, we’ll learn about the philosophical roots of Bounded Contexts from the hard-earned wisdom of Domain-Driven Design. We’ll quickly get our hands dirty in the nuts and bolts of a Context Mapping exercise, a strategic design tool that reveals domain-specific system boundaries. With our newfound architectural vision, we’ll learn how to write context-driven Phoenix code and develop some organizational rules around communication, boundary enforcement and testing between contexts. We’ll leverage the unique powers of Elixir that make this style of architecture so natural and see how using contexts easily leads to highly-cohesive and loosely-coupled outcomes!
About Andrew Hao: Andrew is a software engineer at Carbon Five, where he builds digital products for companies of all shapes and sizes. He enjoys trail running anywhere there are mountains. Though he currently lives in Oakland, he dearly misses his years living in (and eating through) Los Angeles.