Mental Models204 cards · 12 fields

Mental Models/Computing & Information

Abstraction and Modularity

抽象与模块化

Wrap up the complicated part behind a simple handle, so users needn't know what's inside.

On April 26, 1956, the dockworkers at Port Newark in New Jersey no longer carried the cargo aboard piece by piece. A crane lifted 58 metal boxes, already packed with goods, onto the Ideal X, an oil tanker that Malcom McLean had converted. The ship sailed for Houston, and when it arrived the boxes were set straight onto truck trailers. Nobody touched the goods inside the boxes from start to finish; the workers only dealt with the boxes' size, weight and how they were fastened down.

You use abstraction and modularity every day. You've driven for ten years, you get a new car, and you can take it on the road on day one: a car has thousands upon thousands of parts, but the only ones you deal with directly are the steering wheel, the accelerator and the brake. If the maker switches the engine to a different model, you drive the same way, because those three things are still used the same way. Software engineers and freight companies divide up work like this too: users only touch a few agreed operations, and the details inside are changed by whoever is in charge of each part.

Touch three things, and any engine still drives
Only these threeYou, drivingSteering, gas, brakeUsed the same wayEngineAny model will doTransmission10,000+ parts
Only these threeYou, drivingSteering, gas, brakeUsed the same wayEngineAny model will doTransmission10,000+ parts

The steering wheel, accelerator and brake are used the same way, so with a different engine model you still take to the road on day one.

Which details to keep depends on what you're using it for

The lab report a hospital gives a patient lists only each measure, its normal range and an up or down arrow, and hides everything about how the machines measured it. For a patient who wants to know which result is high, that's enough; for the lab that needs to check whether a machine has drifted, it has to dig out the raw curves and quality-control records, and this sheet is no help.

Only when the interface is fully written can you safely swap what's inside

The socket in the wall promises a plug shape and a voltage, and that promise is the interface. A rice cooker only cares about those two things; whatever is done to the circuit board inside makes no difference. If the promise left out the maximum power, and someone plugged in a high-power appliance, it would be the wiring inside the wall that burned. An interface has to spell out what goes in, what comes out, and what happens when something goes wrong.

Details that change for the same reason go in the same module

When the code that talks to the bank is scattered across five places, orders, refunds, reconciliation, reports and customer service, then every time the bank changes its protocol, five places have to change. Gather the bank details into one payment module, and have everywhere else ask it only for "succeeded," "failed" and the amount, and the same change touches just one place. Change the person in charge or the supplier, and the other parts carry on working to the original agreement.

This approach works most smoothly when each part changes on its own and the parts rarely pull on each other, such as replaceable suppliers and software services. When the product's direction changes every week, fixing interfaces early turns untested guesses into rules both sides have to keep. Interfaces can also hide what matters most: if a buyer only looks at the certificate of conformity the supplier sends with the goods and never tests samples, then the day the certificate says the goods pass while the goods are faulty, this interface misses the case that matters most.

Design
When writing a contract for an outside supplier, spell out the format, meaning and deadline of what they deliver and how they pay if it goes wrong; how they do it internally is then not your concern.
Communicate
To explain a complex system to a colleague with no technical background, talk only about the three buttons they will touch and what each one does.
Predict
To estimate how far a change will reach, count how many parts directly use the detail you are changing: the bigger the number, the wider the change will reach.
  1. What am I trying to get done right now? Which details would change my decision, and which can I leave to someone else?
  2. Which details always change together for the same reason, and should they go in the same module?
  3. At the handover, have I spelled out the inputs, what is delivered, the timing, and what happens when something goes wrong?

Manufacturing

Old bricks take new pieces

In 1958, LEGO applied for a patent on the modern brick: hollow tubes were added to the underside, and the size and spacing of the studs were fixed from then on. After that, as long as new molds kept to these few dimensions, the new pieces they made would fit into old bricks bought years before. A child tips out Grandpa's box of old bricks and builds them together with newly bought ones.

Business

Three reports a month

You run a three-person design studio and hand the bookkeeping to an outside accountant, agreeing only that you'll receive a profit and loss statement, a list of money owed to you and a tax list by the 5th of each month, with how they're worked out written into the contract. The accounting firm switches its bookkeeping software and changes the person handling your account, and you still get the three reports every month as usual.

Technology

Different browsers, different websites

Whatever website you open, your browser can display the page. Browsers each have a different engine inside, and websites' servers each run their own software; what the two sides agree on is the same set of rules for sending and laying out web pages. When a website replaces its whole back end and your browser hasn't been updated at all, the page still opens.

Abstraction and ModularityTight Coupling and Cascading FailureWhen every link waits on the last with no slack, one failure runs all the way down.You split a website into three modules, orders, inventory and payments, each deployed on its own with clearly written interfaces. Abstraction and modularity say to rely on the interfaces with confidence and not worry about how the insides change; tight coupling says to first check whether the three modules share the same database or the same network link. If they do, when one breaks they all break, and splitting them up only makes them look independent. Before you start, map out the shared resources behind each module, then decide how detailed the interfaces should be.Abstraction and ModularityConway's LawHowever the teams split up the work, the system they build takes the same shape.Technically, the most sensible boundary is to pull "risk control" out of two lines of business into a module of its own, but right now the people on the two business lines each run their own work and rarely talk to each other. Abstraction and modularity have you draw boundaries by the reasons things change; Conway's law reminds you that boundaries end up growing along the lines of how people communicate. Either first put the people involved in one team, or accept the existing lines between people and draw the boundary there.Abstraction and ModularityThe Map Is Not the TerritoryMaps and reports leave out details, and trouble often hides in what they left out.An interface is a map with details left out. Abstraction and modularity tell you which details to leave out; the map is not the territory has you check whether any of the details left out would change a decision outside. Things that aren't written in the interface documents but would affect you, go and ask about.

A gym chain switched to a new member-data provider. The new provider still delivers the same spreadsheet on time, with the same field names, but has changed "active members" from "came to the gym in the last 30 days" to "opened the app in the last 30 days." The operations manager sees the number of active members going up and is about to add evening trainer shifts.

What should the operations manager do now?

You make a weekly report each for the warehouse manager and for finance, both drawn from the same inventory system. The warehouse manager decides every day which goods to get ready for tomorrow and how many people to send picking orders; finance decides every month which suppliers to pay. At the moment the warehouse manager's weekly report has four items: the current count in each storage spot, the number of each product shipped out during the week, which products are below safety stock, and each supplier's payment terms.

Which item should come out of the warehouse manager's weekly report first?

Your team of five has split its website into nine independent services, each with its own interface documents and release process. Now every new feature means changing four or five of them at once, the four or five sets of interface documents have to be matched up one by one before release, and each release drags on for two or three days.

How should this team adjust next?