liveBook · Manning

Design-first approach

As explained in Automating API Delivery

An API development practice that iteratively creates and validates an API definition before implementing the API in code.

When teams implement an API before agreeing on its design, consumers may discover usability problems only after code has been written. A design-first approach—also called specification-first or contract-first—iteratively creates an API definition before implementation. Treat the definition as a prototype: render it as documentation, mock its behavior, and ask prospective consumers whether it solves their problem. section 1.5.1

Move from an intended consumer outcome to an agreed implementation contract:

  • Identify the capabilities and tasks consumers need. Align stakeholders on the API’s resource model, terminology, and operations before detailing the definition. section 5.2.4
  • Create the OpenAPI definition and review it with consumers and colleagues. Include security mechanisms, breaking-change and deprecation policies, rate limits, and usage plans alongside functional behavior. section 1.5.1
  • Make acceptance explicit—for example, by approving and merging a pull request or changing a review ticket’s status. Implementation should not begin while the agreed design is still in flux. section 5.5.7
Table 5.2 An API operations table for the Product Catalog API
Operation name
Operation Description
Participant
Web resource
Request
Response
listCategories
List all categories
Customer
Category
Filter by field, sort by field, order direction, page size, page cursor
Category
listProducts
List all products
Customer
Product
Filter by field, sort by field, order direction, page size, page cursor
Product
viewProduct
View a product’s details
Customer
Product
Product ID
Product
listProductReviews
List all reviews for a product
Customer
Review
Filter by field, sort by field, order direction, page size, page cursor
Reviews
viewReview
View a product review
Customer
Review
Product ID, Review ID
Reviews

The Product Catalog API operations table makes the proposed contract reviewable: each operation names its participant, resource, request, and response before implementation begins. section 5.2.4

Once the definition is agreed, backend developers can implement the service, testers can write functional tests, and client teams can integrate against a mock in parallel. This can shorten development lead time, but design review still needs human judgment about the consumer experience. A centralized queue of manual approvals can itself become a bottleneck and may miss problems. section 1.5.1 section 1.1

Design-first need not forbid exploratory code. When requirements or technology constraints are unclear, a team may prototype in code, generate a definition, and then refine that definition as the design. If implementation generates another definition later, compare it with the source-of-truth definition from the design phase and fix differences. section 6.3.2

How Automating API Delivery covers it

How deep it goes
Describes iterative definition, mocking, review, approval, and implementation handoff, without prescribing a single universal design-review procedure.
Examples
Uses a Product Catalog API operations table and approval by pull-request merge or review-ticket status change.
What it assumes
Assumes familiarity with API development and reviews while defining design-first from its initial API-definition step.
What you can do after
Practice/perform consumer validation and explicit design approval before coordinating parallel implementation against an agreed API definition.
How it connects
Connects OpenAPI, API product management, resource modeling, design review, API mocking, and API conformance.

Also explained in

Compare how 2 books explain design-first approach →

Related concepts

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