Application programming interface
:'''''API''' redirects here. Alternative meanings in API (disambiguation).'' API with 3 clients, using the [[Unified Modeling Language notation]] 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 necessarily) between lower-level and higher-level software.
Description
One of the primary purposes of an API is to provide a set of commonly-used functions—for example, to draw windows or icons on the screen. Programmers can then take advantage of the API by making use of its functionality, saving them the task of programming everything from scratch. APIs themselves are abstract: software that provides a certain API is often called the implementation of that API. In many instances, an API is synonymous with a SDK, or Software Development Kit. A SDK may include an API as well as other tool/hardware, so the two terms are not strictly interchangeable. For example, one may look at the task of writing "Hello World" on a screen at increasing levels of abstraction: # Do it all yourself: ## Draw, on graph paper, the shapes of the letters H, e, l, l, o, W, o, r, l, d. ## Work out a matrix of black and white squares that look like those letters. ## Devise a way to program the CPU to put this matrix into the display adapter's frame buffer. ## Set the graphics card up to scan its frame buffer to generate the correct signal. # Use an operating system to do some of the work : ## Load a data structure called a "font" provided with the operating system. ## Have the operating system display a blank window. ## Have the operating system draw the text "Hello World" to the window with the font. # Use an application program (which uses an operating system) to do all this hard work: ## Write an HTML document containing the text "Hello World". ## Open the document in a Web browser such as Internet Explorer, Opera or Mozilla Firefox. Obviously, the first option requires more steps, each of them much more complicated than the steps in the subsequent options. In addition, it is impractical to use the first approach to present a substantial amount of information, such as an encyclopedia article, on the screen, whereas the second approach makes the task easier by an order, and the third approach basically requires only that you type "Hello World." However, higher-level APIs often lose flexibility; for example, it would be much more difficult in a web browser to rotate text around a point with blinking outlines, something that could be done easily at the lower levels. This difference is a typical example of the trade-offs encountered by choosing to use an API. APIs are as essential to computers as electrical standards are to the home. One can plug a toaster into the wall whether at home or at a neighbour's house, because both houses conform to the standard electrical interface for an electrical socket. If there wasn't an interface standard, one would have to bring a power station along to make toast! Note that there is nothing stopping somebody else coming up with another standard; a European toaster will not work in the US without a transformer, just as a program written for Microsoft Windows will not work directly on a UNIX system without an intermediate API adapter such as WINE. There are various design models for APIs. Interfaces intended for the fastest execution often consist of sets of functions, procedures, variables and data structures. However, other models exist as well, such as the interpreter used to evaluate expressions in ECMAScript/JavaScript. A good API provides a "black box" or abstraction layer, which prevents the programmer from needing to know how the functions of the API relate to the lower levels of abstraction. This makes it possible to redesign or improve the functions within the API without breaking code that relies on it. Two general lines of policies exist regarding publishing APIs: # Some companies guard their APIs zealously. For example, Sony makes its official PlayStation API available only to licensed PlayStation developers. This is because Sony wants to restrict how many people can write a PlayStation game, and wants to profit from them as much as possible. This is typical of companies who do not profit from the sale of API implementations (in this case, Sony breaks even by selling PlayStation consoles and takes a loss on marketing, intending to make it up through game royalties created by API licensing). # Other companies propagate their APIs freely. For example, Microsoft deliberately makes its API information public, so that software will be written for the Windows platform. The sale of the third-party software sells copies of Windows. This is typical of companies who profit from the sale of API implementations (in this case, Microsoft Windows, which is sold at a gain for Microsoft). Some APIs, such as the ones standard to an operating system, are implemented as separate code libraries that are distributed with the operating system. Others require software publishers to integrate the API functionality directly into the application. This forms another distinction in the examples above. Microsoft Windows APIs come with the operating system for anyone to use. Software for embedded systems such as video game consoles generally falls into the application-integrated category. While an official Playstation API document may be interesting to read, it is of little use without its corresponding implementation, in the form of a separate library or software development kit. An API that 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 authoritative "reference implementations" exist for an API (such as Microsoft Windows for the Win32 API), there's nothing that prevents the creation of additional implementations. For example, most of the Win32 API can be provided under a UNIX system using software called WINE. It is generally lawful to analyze API implementations in order to produce a compatible one. This technique is called reverse engineering for the purposes of interoperability. 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 might include patents that may not be used until the patent holder gives permission.History of the acronym API
The OED defines API in part by saying that IBM developed the API concept in the 1960's. The OED calls it a "high level programming language" which differs from the description in this article slightly, or in any case, is not as nice. c.f interface to further clarify the meaning.Example APIs
- The PC BIOS call interface
- Document Object Models of various applications, such as HTML
- The Single UNIX Specification
- The Microsoft Win32 API
- The J2EE Java 2 Enterprise Edition APIs
- ASPI for SCSI device interfacing
- The Carbon and Cocoa APIs for the Macintosh OS
- The various APIs which make up Microsoft's DirectX
- Simple DirectMedia Layer (SDL)
- The Linux Kernel API http://kernelnewbies.org/documents/kdoc/kernel-api/linuxkernelapi.html
- The OpenGL API for 3D graphics and imaging hardware acceleration
See also
Category:programming Category:Technical communication cs:API de:API et:API fr:Application programming interface hu:Alkalmazásprogramozási felület ja:API nl:API pl:API es:API zh-cn:编程接口pplication programming interface
Aplication programming interface
Aplication programming interface
Appication programming interface
Applcation programming interface
Appliation programming interface
Appliction programming interface
Applicaion programming interface
Applicaton programming interface
Applicatin programming interface
Applicatio programming interface
Applicationprogramming interface
Application rogramming interface
Application pogramming interface
Application prgramming interface
Application proramming interface
Application progamming interface
Application progrmming interface
Application programing interface
Application programing interface
Application programmng interface
Application programmig interface
Application programmin interface
Application programminginterface
Application programming nterface
Application programming iterface
Application programming inerface
Application programming intrface
Application programming inteface
Application programming interace
Application programming interfce
Application programming interfae
Application programming interfac
pAplication programming interface
Application programming interface
Aplpication programming interface
Appilcation programming interface
Applciation programming interface
Appliaction programming interface
Applictaion programming interface
Applicaiton programming interface
Applicatoin programming interface
Applicatino programming interface
Applicatio nprogramming interface
Applicationp rogramming interface
Application rpogramming interface
Application porgramming interface
Application prgoramming interface
Application prorgamming interface
Application progarmming interface
Application progrmaming interface
Application programming interface
Application programimng interface
Application programmnig interface
Application programmign interface
Application programmin ginterface
Application programmingi nterface
Application programming niterface
Application programming itnerface
Application programming inetrface
Application programming intreface
Application programming intefrace
Application programming interafce
Application programming interfcae
Application programming interfaec
Application programming interfac
AApplication programming interface
Appplication programming interface
Appplication programming interface
Appllication programming interface
Appliication programming interface
Appliccation programming interface
Applicaation programming interface
Applicattion programming interface
Applicatiion programming interface
Applicatioon programming interface
Applicationn programming interface
Application programming interface
Application pprogramming interface
Application prrogramming interface
Application proogramming interface
Application proggramming interface
Application progrramming interface
Application prograamming interface
Application programmming interface
Application programmming interface
Application programmiing interface
Application programminng interface
Application programmingg interface
Application programming interface
Application programming iinterface
Application programming innterface
Application programming intterface
Application programming inteerface
Application programming interrface
Application programming interfface
Application programming interfaace
Application programming interfacce
Application programming interfacee
pplication programming interface
aplication programming interface
aplication programming interface
appication programming interface
applcation programming interface
appliation programming interface
appliction programming interface
applicaion programming interface
applicaton programming interface
applicatin programming interface
applicatio programming interface
applicationprogramming interface
application rogramming interface
application pogramming interface
application prgramming interface
application proramming interface
application progamming interface
application progrmming interface
application programing interface
application programing interface
application programmng interface
application programmig interface
application programmin interface
application programminginterface
application programming nterface
application programming iterface
application programming inerface
application programming intrface
application programming inteface
application programming interace
application programming interfce
application programming interfae
application programming interfac
paplication programming interface
application programming interface
aplpication programming interface
appilcation programming interface
applciation programming interface
appliaction programming interface
applictaion programming interface
applicaiton programming interface
applicatoin programming interface
applicatino programming interface
applicatio nprogramming interface
applicationp rogramming interface
application rpogramming interface
application porgramming interface
application prgoramming interface
application prorgamming interface
application progarmming interface
application progrmaming interface
application programming interface
application programimng interface
application programmnig interface
application programmign interface
application programmin ginterface
application programmingi nterface
application programming niterface
application programming itnerface
application programming inetrface
application programming intreface
application programming intefrace
application programming interafce
application programming interfcae
application programming interfaec
application programming interfac
aapplication programming interface
appplication programming interface
appplication programming interface
appllication programming interface
appliication programming interface
appliccation programming interface
applicaation programming interface
applicattion programming interface
applicatiion programming interface
applicatioon programming interface
applicationn programming interface
application programming interface
application pprogramming interface
application prrogramming interface
application proogramming interface
application proggramming interface
application progrramming interface
application prograamming interface
application programmming interface
application programmming interface
application programmiing interface
application programminng interface
application programmingg interface
application programming interface
application programming iinterface
application programming innterface
application programming intterface
application programming inteerface
application programming interrface
application programming interfface
application programming interfaace
application programming interfacce
application programming interfacee