Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

API development - Design considerations [closed]

Tags:

open-source

In my 4 years of experience,I have developed a lot of web applications. Now, the concept of programmable web getting more and more popular, new APIs are being released almost everyday. I would like to develop a java API/library for a few of these endpoints.Ex stackapps,reddit,digg etc... What I would like to know from you people is ,

  • How is the API of the regular web apps differ from the API of these libraries. Or what is the difference between these two from design perspective
  • What are the best API development practices.
  • What are all the factors that I need to consider before designing the API

.

Please comment, if the details are not sufficient.

like image 521
chedine Avatar asked Jun 28 '10 12:06

chedine


People also ask

What does closed API mean?

A closed API, on the other hand, is one that individuals can only access through an organization's internal IT estate or a private network.

What is open API vs closed API?

An open API has access restrictions because they are openly accessible to the public and can be invoked from anywhere on the open internet. On the other hand, a closed API, also known as a private API, is not accessible openly on the internet.


1 Answers

Stability

If you offer an API to your web app, it is probably because you want other people to build applications using it. If it is not stable they will hate you for forcing them to follow through your frequent changes. If this takes too long, their site might remain non-functional for a long time while they are figuring out the new way of doing things in your API.

Compactness

You want the API to be complete but compact, as in not too much to remember.

Orthogonality

Design it so there is one and only one way to change each property or trigger an action. Actions in an orthogonal API should have minimal (if ever) side effects.

Also, it's not a good practice to remove a feature from a public API once released.

Security and Authentication

Since the API is web-exposed, you will have to authenticate each request and grant appropriate access. Security common sense applies here.

Fast Responses or Break into pieces

I believe in a web environment we should have fast responses and avoid requests that will take too long to complete. If it's unavoidable then it is better to send an ACK and break the task into several pieces and subsequent calls.

like image 190
bakkal Avatar answered Sep 29 '22 08:09

bakkal