liveBook · Manning

Maintainability

As explained in Grokking Software Architecture

Maintainability is the degree to which software can be understood, corrected, modified, or extended efficiently over time.

Imagine returning to code you wrote months ago and needing a map just to fix one bug. Maintainability is how easily someone can understand, correct, change, or extend software over time. Code is read far more often than it is written, so clarity for the next reader—including future you—is worth the effort. section 2.4 section 3.1

Where should favorites live?

Adding a comma-separated favorites list to each user profile is quick and simple, but the management code is messy and fragile. A separate favorites storage area keeps that data isolated and can scale without slowing down profiles. The price is a new table, more complex queries, and a slower initial delivery. The first option also risks losing a favorite when simultaneous saves overwrite one another. section 1.5.5

Separation of concerns helps make changes easier to locate and contain. Cohesion asks whether the things inside a module belong together; coupling asks how much modules depend on one another. A refactored order process with a dedicated payment service puts payment changes in one place, while separate pieces can be tested independently. The tradeoff is managing more files. section 3.1 section 3.5.4

Swap the logger, not the business logic

An order service can receive a logger through an abstraction instead of tying its business logic to a file logger. Changing the registered logger can then update the application without changing that logic; a fake logger also makes the service easier to test. The design adds an interface and constructor setup. section 4.5.3

Before adding flexibility everywhere, ask:

  • Which logic or data is likely to change? Focus flexibility there. section 3.4.6
  • Which parts will other developers work with? Prioritize clarity in shared areas. section 3.4.6
  • What assumptions could become fragile, and are too many things coupled together? section 3.4.6
  • Could a new requirement be added without changing existing code? How difficult would a unit test be? section 3.4.6
Figure 2.11 The Tradeoff Triangle allows you to visualize priorities quickly.

Use the Tradeoff Triangle to make ease of change visible alongside competing priorities such as speed to ship and operating cost. Place a dot to show the current decision, then explain the compromise. section 2.8

There is no perfect design. Decide how much ease of change matters for the current business goal, make its costs explicit, and choose the tradeoff deliberately. section 1.5.5 section 1.10

How Grokking Software Architecture covers it

How deep it goes
Defines the quality and develops design questions, concrete tradeoffs, and refactoring outcomes rather than a quantitative measure.
Examples
Compares favorites storage options and illustrates an order-process refactor and an injected logger.
What you can do after
Evaluate design options and apply a checklist to spot fragile assumptions, tight coupling, and difficult-to-test boundaries.
How it connects
Connects maintainability to separation of concerns, cohesion, coupling, testability, and dependency inversion.

Also explained in

Compare how 10 books explain maintainability →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.