Jump to content

API

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 8.225.1.24 (talk) at 17:16, 4 February 2009. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

An application programming interface FOR REAL!!! (API) is a set of routines, data structures, object classes and/or protocols provided by libraries and/or operating system services in order to support the building of applications.[1] An API may be:

  • Language-dependent, that is, only available in a particular programming language, utilizing the particular syntax and elements of the programming language to make the API convenient to use in this particular context.
  • Language-independent, that is, written in a way that means they can be called from several programming languages (typically an assembly/C-level interface). This is a desired feature for a service-style API which is not bound to a particular process or system and is available as a remote procedure call.

The API itself is largely abstract in that it specifies an interface and the behavior of the objects specified in that interface; the software that provides the functionality described by an API is said to be an implementation of the API. An API is typically defined in terms of the programming language used to build an application. The related term ABI is a lower level definition concerning details at the asm-level. For example, the Linux Standard Base is an ABI (Application Binary Interface), while POSIX is an API.[2]

The API acronym may sometimes be used as a reference not only to the full interface but also to a single function or even a set of multiple APIs provided by an organization. Thus the scope is usually determined by the person or document that communicates the information.

Implementations

The POSIX standard defines an API that allows a wide range of common computing functions to be written such that they may operate on many different systems (Mac OS X and various BSDs implement this interface); however, making use of this requires re-compilation for each platform. A compatible ABI, on the other hand, allows compiled object code to function without any changes, on any system implementing that ABI. This is advantageous to both software providers (where they may distribute existing software on new systems without producing/distributing upgrades) and users (where they may install older software on their new systems without purchasing upgrades), although this generally requires various software libraries implementing the necessary APIs too.

Microsoft has shown significant commitment to a backward compatible ABI, particularly within their Win32 library, such that older applications may run on newer versions of Windows. Apple Inc. has shown less propensity to this concern, expiring compatibility or implementing ABI in a slower "emulation mode"; this allows greater freedom in development at the cost of obsoleting older software. Among Unix-like operating systems, there are many related but incompatible operating systems running on a common hardware platform (particularly Intel 80386-compatible systems). There have been several attempts to standardise the ABI such that software vendors may distribute one binary application for all these systems; however to date, none of these have met with much success. The Linux Standard Base is attempting to do this for the Linux platform whilst many of the BSD unices (OpenBSD/NetBSD/FreeBSD) implement various levels of ABI compatibility for both backward compatibility (allowing applications written for older versions to run on newer distributions of the system) and cross-platform compatibility (allowing the execution of foreign code without recompilation).

Release policies

There are several kinds of API publishing policies often encountered, including the following:

  1. Companies do not release API information to anybody outside of the company.
  2. Companies protect information on their APIs from the general public. For example, Sony used to make its official PlayStation 2 API available only to licensed PlayStation developers. This enabled Sony to control who wrote PlayStation 2 games. Such control can have quality control benefits and potential license revenue.
  3. Companies make their APIs freely available. For example, Microsoft makes the Microsoft Windows API public and Apple releases its APIs Carbon and Cocoa so that software can be written for their platform.

API examples

Below are listed some well-known APIs.

Language bindings and interface generators

Below are listed some interface generator tools.

See also

References

  1. ^ "QuickStudy: Application Programming Interface (API)". ComputerWorld.
  2. ^ "Update on Standards" (PDF). USENIX.