究竟什么是API的意义? [英] What exactly is the meaning of an API?

查看:123
本文介绍了究竟什么是API的意义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索过一种编程语言的API定义,我仍然发现很难理解了。

任何人都可以咨询我简单的,通俗地说:


  1. 什么是API?

  2. 如何使用它?

  3. 何时何地使用它?


解决方案

搜索应该包括维基百科,这是的出奇的好的可用于许多编程概念/术语如的Application编程接口:

什么是API?


  

    

这是应用程序编程接口(API)是软件程序可以遵循相互以通讯规则('code')和规格特定的一组。它作为不同的软件程序之间的接口和便于它们的相互作用,类似于用户界面便于人类与计算机之间的交互的方式。


  

它是如何使用的?

的相同的方式的任何组规则被使用。

何时何地使用它?

:取决于境界和API,自然。考虑这些:


  1. 在x86(IA-32)指令集(非常有用; - )

  2. 系统 BIOS中断调用

  3. 的OpenGL 这往往是公开为C库

  4. 核心Windows系统调用: WinAPI的

  5. Ruby的核心库

  6. 文档对象模型通过浏览器接触到的JavaScript

  7. Web服务时,例如通过 Facebook的图形API

  8. 的协议,如 JNI在Java中
  9. 的实现

快乐编码。

I've searched for the definition of an API in a programming language and I am still finding it hard to understand.

Could anyone advice me in simple, layman's terms:

  1. What is an API?
  2. How is it used?
  3. When and where is it used?

解决方案

Searches should include Wikipedia, which is surprisingly good for a number of programming concepts/terms such as Application Programming Interface:

What is an API?

An application programming interface (API) is a particular set of rules ('code') and specifications that software programs can follow to communicate with each other. It serves as an interface between different software programs and facilitates their interaction, similar to the way the user interface facilitates interaction between humans and computers.

How is it used?

The same way any set of rules are used.

When and where is it used?

Depends upon realm and API, naturally. Consider these:

  1. The x86 (IA-32) Instruction Set (very useful ;-)
  2. A BIOS interrupt call
  3. OpenGL which is often exposed as a C library
  4. Core Windows system calls: WinAPI
  5. The Classes and Methods in Ruby's core library
  6. The Document Object Model exposed by browsers to JavaScript
  7. Web services, such as those provided by Facebook's Graph API
  8. An implementation of a protocol such as JNI in Java

Happy coding.

这篇关于究竟什么是API的意义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆