Principles¶
Design principles that apply regardless of technology, team size or architecture style.
Entries are sorted by score from 1 to 10 (criteria): 9โ10 start here or strongly recommended, 6โ8 recommended, 1โ5 further reading or conditional.
Adopted references¶
- 9 Software Architecture Guide (Martin Fowler): the entry point for what architecture is and why internal quality matters.
- 8 Architectural principles (Microsoft): a compact, technology-agnostic list. It covers separation of concerns, encapsulation, dependency inversion, explicit dependencies, single responsibility, DRY, persistence ignorance and bounded contexts.
- 7 The Principles of OOD (Robert C. Martin): the original SOLID and package-design principles.
- 7 Beck Design Rules (Kent Beck via Martin Fowler): the four rules of simple design.
Key rules¶
Focus¶
- 8
PRIN-1Spend architecture effort on the decisions that are hard to change. Architecture is "the important stuff, whatever that is". Usually that means the decisions people wish they could get right early, the ones they perceive as hard to change. (Fowler, Software Architecture Guide, Who Needs an Architect?) - 8
PRIN-2Treat internal quality as a speed investment, not a cost. Cruft slows feature delivery within weeks, so high internal quality makes software cheaper to change. (Fowler, Is High Quality Software Worth the Cost?, Design Stamina Hypothesis) - 7
PRIN-3Reduce irreversibility where you can. Much of an architect's job is finding ways to make decisions reversible, so fewer of them become "architecture". (Fowler, Who Needs an Architect?)
Modularity¶
- 9
PRIN-4Separate concerns and encapsulate decisions behind interfaces. Each module should hide its internals and expose a well-defined contract. (Microsoft, Architectural principles) - 7
PRIN-5Gather together the things that change for the same reasons; separate those that change for different reasons. (Martin, The Single Responsibility Principle) - 7
PRIN-6Point dependencies at abstractions and make them explicit. High-level policy should not depend on low-level details, and a class should declare what it needs, for example in its constructor. (Microsoft, Architectural principles, Martin, Principles of OOD) - 7
PRIN-7Decompose by design decisions likely to change, not by processing steps. (Parnas, On the Criteria to Be Used in Decomposing Systems into Modules, open copy) - 7
PRIN-8Keep each piece of knowledge in one place (DRY). (Microsoft, Architectural principles)
Simplicity¶
- 7
PRIN-9Don't build capabilities for presumed future needs (YAGNI), but do keep the code easy to change. YAGNI doesn't apply to refactoring and other work that makes the software easier to modify. (Fowler, Yagni) - 7
PRIN-10Prefer the simplest design that passes the tests, reveals intention, has no duplication and has the fewest elements. (Beck Design Rules) - 6
PRIN-11Take on technical debt deliberately and prudently, and know when you're doing it. (Fowler, Technical Debt Quadrant)
Concurrency¶
- 7
PRIN-16Start every concurrent task in a scope, such as a task group, that waits for it to finish or cancels it before the scope ends (structured concurrency), so that no task outlives the code that owns it. A task that nothing waits for can keep running after its caller has failed, leak resources, and lose its errors. Platform examples:GO-6,PY-10,IOS-5andNODE-2. (Smith, Notes on structured concurrency, or: Go statement considered harmful, OpenJDK, JEP 543: Structured Concurrency)
Socio-technical design¶
- 7
PRIN-12Expect system structure to mirror communication structure (Conway's law). Design teams and architecture together. (Fowler, Conway's Law, Conway, original paper) - 7
PRIN-13Aim for an architecture where teams can test and deploy independently. It is one of the capabilities that drive delivery performance. (DORA, Loosely coupled teams) - 5
PRIN-14Shape teams to get the architecture you want (Inverse Conway Maneuver). (Thoughtworks Technology Radar) - 5
PRIN-15Draw team boundaries to manage cognitive load, using clear team types and interaction modes. (Team Topologies key concepts, Fowler, Team Topologies)
Tutorials and further reading¶
- 6 Is Design Dead? (Martin Fowler): how design works in evolutionary, agile development.
- 6 Refactoring.Guru: design patterns: an illustrated tutorial on the classic design patterns.
- 5 Sacrificial Architecture (Martin Fowler): when it's right to plan to throw code away.