Design · lesson 1 of 10
Ideas in this lesson
ADesigndeciding how the system will meet its requirements
BUp front or emergenthow much to decide before coding
CHard-to-reverse decisionsthe ones that deserve the most care

What design is for

Last updated

Requirements say what Pila must do. Design decides how: what the parts are, how they talk, where the data lives. Some of those decisions are cheap to change next month; others shape everything built on top of them. In this lesson you'll see what design is, how much of it to do before coding, and how to tell the decisions that deserve the most thought.

By the end of this lesson you can

  • Explain what software design is, and why it comes before and alongside code
  • Compare designing everything up front with letting the design emerge
  • Tell decisions that are easy to change later from ones that are hard to change

Design is decisions

Design is deciding how a system will meet its requirements: what its parts are, what each part is responsible for, how they talk to each other, and where the data lives. The largest of these decisions, the ones that shape the whole system, are called its architecture. The architecture standard, ISO/IEC/IEEE 42010, describes it as the fundamental concepts or properties of a system, written for the people who care about it.

Every system has a design, even if nobody drew one: the code is full of decisions. The question is whether they were made on purpose, with the requirements in view, or by accident, one file at a time. Lesson 3.6's Monday morning was a design decision nobody made: the code re-read the whole queue on every text.

Up front, or as you go?

How much to design before writing code is an old argument.

Two ways to design
Big design up frontEmergent design
IdeaDesign the whole system before buildingDesign enough to start, and improve the design as the code grows
FitsWaterfall and the V (lessons 2.2 and 2.3); fixed, well-understood problemsIterative and Agile work (lessons 2.4 to 2.8)
RiskDesigning for requirements that turn out wrongNever stepping back to look at the whole, and drifting into a mess
NeedsStable requirementsTests and constant small refactoring (lesson 8.3), so the design can change safely

Martin Fowler's essay "Is Design Dead?" answers: no. Extreme Programming didn't remove design; it moved most of it into small, continuous decisions, backed by tests. XP's YAGNI, "you aren't gonna need it", warns against building for features you only imagine. But both sides agree that a few decisions need thought before the first line of code: the ones that are hard to undo.

Easy and hard to change later

The best use of design time is on decisions that will be expensive to reverse, and the least on decisions you can change tomorrow. Sort Pila's decisions.

0 of 7 placed right

  1. The wording of the reply text: “You are number 38.”

  2. Patients get numbers by text message, not by a smartphone app

  3. The colours of the counter page

  4. What is stored about each patient, and for how long

  5. Which SMS company sends the texts

  6. The order of buttons on the counter page

  7. Running Pila as one program, rather than as several services

Notice the SMS company. A good design can move a decision from "hard" to "easy" by hiding it behind a clear boundary. That's what most of this stage is about.

Spot the trap: this year's favourite database

Spot the trapMarco

Marco has read that a new kind of database is the most popular choice this year. “Everyone’s moving to it. Let’s use it for Pila.”

What happens if…

Check what you learned

Which decision deserves the most design time?
What does emergent design rely on to stay safe?
How can good design make choosing the SMS company an easy-to-change decision?

Sources

Every claim on this page comes from these sources: the standard, the founding text of a method, a study, or the official record of a project, from the body that publishes it. Industry reports are labelled as such.

All sources for Simple Software Development