API-DD library · Page 2 of 2
Articles on designing modules as APIs
Practical guides about conversations, guarantees, and boundaries between modules. If this is your first visit, start with the API-Driven Development manifesto.
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.
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.
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.