Wednesday, April 9th, 2008

A wishlist for Ajax APIs

Category: Ajax

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.

As an example I used the Google translation API, pointed out its good points and explained what I’d love to see added to it. Specifically any JavaScript Ajax API to me should have the following:

  • 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
1 Comment

4.3 rating from 38 votes

1 Comment »

Comments feed TrackBack URI

Hey, your rating widget just got hacked ;)
I guess it’s an argument in the “Business Logic on the Client debate”… ;)

Comment by polterguy — April 9, 2008

Leave a comment

You must be logged in to post a comment.