Wednesday, April 9th, 2008
Following discussions at the Highland Fling conference with the audience and Gareth Rushgrove (whose excellent presentation on API design we featured here already) I sat down and came up with a wishlist for a great Ajax API.
- Have a good documentation with immediate copy and paste examples backed up by a full class documentation
- Build your APIs modular and allow the implementer to choose the version they want to have
- Provide a hook to link the result of the API methods to the initial data entered. The easiest way is to repeat this data, more sophisticated is to allow for a connection ID.
- Allow for multiple values to be sent through, itâ€™ll save you API calls and the implementer hacking around the problem of unreliable order of returns.
- Allow implementers to add an own object to send and get back to allow for namespacing and other data state retention.
- Allow for a timeout, connections are not to be trusted.
Check out the full rationale and more detailed explanations on the blog: designing a great Ajax API.
Posted by Chris Heilmann at 2:24 am