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.
| Big design up front | Emergent design | |
|---|---|---|
| Idea | Design the whole system before building | Design enough to start, and improve the design as the code grows |
| Fits | Waterfall and the V (lessons 2.2 and 2.3); fixed, well-understood problems | Iterative and Agile work (lessons 2.4 to 2.8) |
| Risk | Designing for requirements that turn out wrong | Never stepping back to look at the whole, and drifting into a mess |
| Needs | Stable requirements | Tests 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
The wording of the reply text: “You are number 38.”
Patients get numbers by text message, not by a smartphone app
The colours of the counter page
What is stored about each patient, and for how long
Which SMS company sends the texts
The order of buttons on the counter page
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
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
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.
- IEEE Computer Society: SWEBOK Guide, version 4.0 (2024): software design and architecture as knowledge areas
- ISO/IEC/IEEE 42010:2022, Architecture description: architecture as the fundamental concepts of a system, described for its stakeholders’ concerns
- Martin Fowler, “Is Design Dead?”: planned and evolutionary design, and how Extreme Programming changed the balance
- Martin Fowler: Yagni: “you aren’t gonna need it”: not building for features you only imagine