Developer! Developer! Developer! East Anglia

DDD East Anglia

Cambridge, UK
Saturday 26 September 2015

5 Anti-Patterns in designing APIs

This talks elaborates on the Client-Server tenet of REST which focuses on separation of concerns between the client and the server. In the first third of the talk, I will talk about what the ideal client and servers are and examples of how their responsibilities. I will touch on how the word Server has lost its meaning of "serving" and the client has been overshadowed by the focus to the API. I will also compare the API to a restaurant and how its menu is the API's REST resources.

In the rest of the talk, I look at some important anti-patterns commonly seen in the industry (each with at least one example):

1) Chauvinist Server: designing the API from server's perspective failing to hide its complexity behind its API (API designed from the server's perspective) 2) Demanding client: client enforcing its special need onto the signature of the API (certain client's limitation becomes server's default behaviour) 3) Transparent Server: server exposing its internal implementation to its clients (server's underlying or private domain bleeds into the public API) 4) Presumptuous Client: The client assuming the role of a server and engage in taking responsibilities that cannot guarantee 5) Assuming Server: Server that assumes the responsibility of tailoring the response based on what it assumes client is (e.g. browser sniffing)