Consistent

The principle of consistency is very important in API design. Arnaud Lauret, the author of the book The Design of Everyday APIs, elegantly outlined four different types of consistency in his blog post The four levels of consistency in API design (restlet.com/company/blog/2017/05/18/the-four-levels-of-consistency-in-api-design/), which we've summarized here:

  • Common: Being consistent with the world
  • Local: Being consistent within the same API
  • Transversal: Being consistent across different APIs by the same organization
  • Domain: Being consistent with a specific domain

I have made one addition to this list—perennial consistencyor being consistency across time.

Let's examine each one individually.

Get Building Enterprise JavaScript Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.