[Home]Application programming interface

HomePage | Recent Changes | Preferences

Showing revision 3
Application Programming Interface (API) is a set of definitions of the ways in which one piece of computer software communicates with another. It is a method of achieving abstraction?, usually (but not necesserily between lower-level and higher-level software). Generally, the main purpose of API is to spare from the programmer the need to write software from scratch. A set of programs that comply to a certain API are called an implementation.

For example, one may look at the task of writing "Hello World" on the screen:

  1. Do it all yourself:
    1. Draw, on graph paper, the shapes of the letters H, e, l, o, W, r, d.
    2. Work out a matrix of black and white squares that look like those letters.
    3. Work out the sequence of electrical pulses that I need to send to the computer screen to draw that matrix. It might be 5 volts for black, 1 volt for white.
    4. Repeat the sequence every 60th of a second to keep the message displayed, exploiting persistence of vision.
  2. Use somebody else's program to do all this hard work.

APIs are as essential to computers as electrical standards are to the home. One can plug his toaster into the wall whether he is at home or at a neighbour's house, because both houses conform to the standard API for an electrical socket. If there wasn't an API standard, I would have to bring a power station with me to make my toast! Note that there is nothing stopping somebody else coming up with another standard; a UK toaster will not work in the US, just as a program written for Microsoft Windows will not work directly on DOS.

Two general lines of policies exist regarding publishing APIs:

An API which does require royalties for access and usage is called open. The APIs provided by Free software (such as software distributed under the GNU General Public License), are open by definition, since anyone can look into the source of the software and figure out the API basing on it. Although usually authorative implementations exist for an API (such as Microsoft Windows for Windows API), there's nothing (besides legal constraints) that prevents the creation of additional implementations. For example, Windows API can be provided under Linux using software called [Wine].

Examples of APIs are:


HomePage | Recent Changes | Preferences
This page is read-only | View other revisions | View current revision
Edited December 13, 2001 1:10 am by Uriyan (diff)
Search: