liveBook · Manning

Api pattern

As explained in API Design Patterns

An API design pattern is a reusable solution structure for designing and structuring an API's interface and, sometimes, its externally observable behavior.

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)

Option

Difficulty

Flexibility

Software equivalent

Buy pre-built

Simple

None

Use a pre-built software package

Assemble from a kit

Easy

Very little

Build by customizing existing software

Build from blueprints

Moderate

Some

Build from a design document

Build from scratch

Difficult

Most

Write completely custom software

Compare solution difficulty, flexibility, and software equivalents in one table. section 2.1

How API Design Patterns covers it

How deep it goes
Defines patterns as adaptable blueprints and contrasts solution difficulty with flexibility, without detailing API mechanics.
Examples
Uses shed construction options to represent pre-built, customized, blueprint-based, and from-scratch software approaches.
What it assumes
Assumes a basic understanding of software structure and explains reusable design solutions from the ground up.
What you can do after
Evaluate reusable API solutions against custom development by comparing their difficulty and flexibility.
How it connects
Connects API design patterns with software design, design documents, software packages, and custom software.

Also explained in

Compare how 2 books explain api pattern →

Related concepts

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