An API design pattern is a reusable blueprint for solving similarly structured interface problems. It is not a pre-built library; it provides a structure that can be adjusted for different scenarios. section 2.1
Choosing a reusable pattern involves a flexibility–difficulty trade-off:
- Pre-built solutions are simplest but offer little or no flexibility. section 2.1
- Customizing an existing design offers moderate difficulty and some flexibility. section 2.1
- Building completely from scratch is most difficult but provides the greatest flexibility. section 2.1
Shed-building analogy
Buying a pre-built shed parallels using an existing software package; assembling a kit parallels customizing software; modifying blueprints parallels building from a design document; and designing from scratch parallels writing custom software. section 2.1
Table 2.1 Comparison of ways to build a shed with ways to build software (view table figure)
Compare solution difficulty, flexibility, and software equivalents in one table. section 2.1

