Part 2 of 8 · 1 min read
A good boundary
High cohesion inside, loose coupling across.
Think of how a hospital is divided. Surgery, pharmacy and billing each have their own staff, tools and words. A patient crosses between them through a front desk with forms. Nobody in billing walks into the operating room to change a record.
Page 2 gave two measures: cohesion (how well the parts of a module belong together) and coupling (how much modules depend on each other). A good service boundary has both: related behaviour sits in one place, and the contact with other places is small and explicit. BM states the aim as finding boundaries where related behaviour is kept together and where talk across the boundary is as loose as possible.
The tool BM uses is the bounded context from Eric Evans's book on domain-driven design (DDD). BM's own definition is short: a specific responsibility enforced by explicit boundaries. Evans compares it to a cell. The membrane decides what is in, what is out, and what may pass.
Bounded context
A bounded context is a part of the business with one clear responsibility. It has an explicit interface, and it chooses which of its models it shares with others.
Example: the warehouse is one context and finance is another. Finance gets stock levels from the warehouse but never sees the forklift schedules.
Check yourself: 1. Which two measures from page 2 decide whether a boundary is good? 2. In the hospital picture, what plays the part of the explicit interface? 3. Why is a cell membrane a good picture of a boundary?