API: Difference between revisions

Content deleted Content added
m Reverting possible vandalism by 67.216.118.246 to version by 逆襲的天邪鬼. Report False Positive? Thanks, ClueBot NG. (2820613) (Bot)
The Content is not specific to the term
Tag: references removed
Line 9:
 
== Purpose ==
Just as a [[graphical user interface]] makes it easier for people to use programs, application programming interfaces make it easier for [[Software developer|developers]] to use certain technologies in building applications.
By [[Abstraction (software engineering)|abstracting]] the underlying implementation and only exposing objects or actions the developer needs, an API reduces the cognitive load on a programmer.
While a graphical interface for an [[email client]] might provide a user with a button that performs all the steps for fetching and highlighting new emails, an API for file [[input/output]] might give the developer a [[Subroutine|function]] that copies a file from one ___location to another without requiring that the developer understand the [[File system journaling|file system]] operations occurring behind the scenes.<ref name="Clarke4">{{cite web|last1=Clarke|first1=Steven|title=Measuring API Usability|url=http://www.drdobbs.com/windows/measuring-api-usability/184405654|website=Dr. Dobb's|accessdate=29 July 2016|date=2004}}</ref>
 
== Uses ==
 
===Libraries and frameworks===
Java|url=http://www.artima.com/pins1ed/combining-scala-and-java.html|website=www.artima.com|accessdate=29 July 2016|date=10 December 2008}}</ref>
An API is usually related to a [[software library]]: the API describes and prescribes the ''expected behavior'' while the library is an ''actual implementation'' of this set of rules.
A single API can have multiple implementations (or none, being abstract) in the form of different libraries that share the same programming interface.
The separation of the API from its implementation can allow programs written in one language to use a library written in another.
For example, because [[Scala (programming language)|Scala]] and [[Scala (programming language)|Java]] compile to compatible [[bytecode]], Scala developers can take advantage of any Java API.<ref name="OderskySpoonVenners8">{{cite web|last1=Odersky|first1=Martin|last2=Spoon|first2=Lex|last3=Venners|first3=Bill|title=Combining Scala and Java|url=http://www.artima.com/pins1ed/combining-scala-and-java.html|website=www.artima.com|accessdate=29 July 2016|date=10 December 2008}}</ref>
 
API use can vary depending on the type of programming language involved.