API-DD

API-DD library · Page 2 of 2

API-DD Design

Practical guides about conversations, guarantees, and boundaries between modules. If this is your first visit, start with the API-Driven Development manifesto.

  1. The constructor that allows an invalid value to exist

    Comparing setters plus Validate with atomic Interval creation shows how to protect invariants and define the meaning of Go's zero value.

    Read article →Explore: Foundation 4: Autonomy →

  2. The single-implementation interface that increases coupling

    A conventional UserServiceInterface forces different consumers to depend on the same broad contract and shows when the interface belongs to the consumer.

    Read article →Explore: Foundation 1: Recursion →

  3. The getter that lets a consumer modify the module

    A seemingly innocent Go getter returns its internal slice, letting consumers change the module and making previously returned results change unexpectedly.

    Read article →Explore: Foundation 4: Autonomy →

  4. The type that turns a SQL change into an interface change

    A Go example of an innocent-looking dependency: returning sql.Rows makes the consumer understand the query and turns internal changes into interface changes.

    Read article →Explore: Foundation 3: Visibility →