Saturday, 18 August 2012

How to design a good API

From  a talk by Joshua Bloch:

  • API design is very similar to Language and language feature design.
  • Easy to evolve, hard to misuse
  • Gather requirements with healthy degree of skepticism. Define use cases from the requirements. Often it is easier and more rewarding to solve a more general form of problem than solving a specific problem so keep your mind open.
  • Keep the initial spec of the API short/1 page. And discuss with as many people and then flesh it out as confidence builds.
  • Write to the API (means write clients using API interface) as you design the API, this is very important as it allows you to explore the use cases API is being designed to solve.
  • API should do ONE thing good.

No comments:

Post a Comment