Book Deep Read · Fundamentals of Software Architecture · Chapter 8

Component-Based Thinking: Decide How to Cut Before Deciding How Fine

Fundamentals of Software Architecture · Ch 8 · Mark Richards & Neal Ford · 2020

中文 →

What is this chapter about?

When you buy a shirt online, the software behind the shop handles products, the cart, payment and shipping. Once software gets big, it has to be split into a few large chunks, each owned by a group of people. This chapter asks: how should those chunks be divided? It sounds minor, but it is one of the earliest decisions an architect makes, and one of the hardest to undo.

An analogy: dividing up a restaurant kitchen

One way is by skill: everyone who chops in one team, everyone who cooks in another, everyone who plates in a third. Another way is by cuisine: one team does Sichuan dishes from chopping to plating, another does Cantonese. Split by skill, each team is very specialized, but when a new dish is added, all three teams must change how they work and wait on each other. Split by cuisine, one team owns a dish end to end and can change it quickly; the cost is that every team needs people who can chop and cook.

Why the old way was hard

Developers know the skill split best: one layer for screens, one for business rules, one for the database. It feels natural, but when the business changes — say the checkout process — all three layers must change and three groups must meet to schedule it. Another common trap is splitting by nouns: there is a "customer", so build a customer module; there is an "order", so build an order module. Each module only stores and fetches its own data, and the real business process belongs to no one, scattered everywhere.

The core idea: pick a cut, then refine in rounds

The book's method is like measuring a room again and again before renovating. First cut a rough set of chunks. Then drop each requirement into one and see which chunk has no room and which is too crowded. Ask each chunk "what exactly are you responsible for?" Then look at the pressure each must bear — on an auction site, tens of thousands of viewers may rush in to bid, while the single auctioneer on stage must never drop out, so the two should not share a chunk. Then cut again, round after round; nobody gets it right the first time. Where to look for chunks matters too: don't start from nouns, start from "who does what", or from "what happens".

What it buys you / how to choose

Split by business, and the shape of the software matches the shape of the business, which also makes it easier to break off independent systems later. Split by skill, and it suits simple systems that really are just "form, rules, storage". Chunk size is a trade-off too: too small, and chunks spend all day passing messages; too large, and one chunk holds unrelated things, so one change ripples everywhere. The honest cost: once you split by business, shared utilities that "everyone needs" end up written in several places.

One line to remember

To split software, first choose "cut by business" or "cut by skill", then find chunks from "who does what", and refine in rounds — chunks are revised into shape, not drawn right once.

Want the full technical-vs-domain partitioning comparison, Conway's Law, why the Entity Trap is an anti-pattern, and how the auction system's components were found? → Switch to Deep