(redirected from Application Programming Interface)

[Home]Application programming interface

HomePage | Recent Changes | Preferences

An 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 an API is to spare from the programmer the need to write software from scratch.

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 you 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 not 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. Although usually authorative implementations exist for an API (such as Microsoft Windows for Windows API), there's nothing that prevents the creation of additional implementations. For example, the Windows API can be provided under Linux using software called [Wine].

It is generally legal to analyze API implementations in order to produce a compatible one. This technique is called reverse engineering for the purposes of compatibility. However, the legal situation is often ambiguous, so that care and legal counsel should be taken before the reverse engineering is carried out. For example, while APIs usually do not have an obvious legal status, they may include patents that may not be used until the patent holder gives his permission.

Examples of APIs are:


HomePage | Recent Changes | Preferences
This page is read-only | View other revisions
Last edited December 13, 2001 4:40 am by Uriyan (diff)
Search: