API的确切含义是什么? [英] What exactly is the meaning of an API?

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

问题描述

我在编程语言中搜索了 API 的定义,但我仍然发现它很难理解.

谁能用简单的外行术语给我建议:

  1. 什么是 API?
  2. 它是如何使用的?
  3. 何时何地使用它?

解决方案

搜索应该包括维基百科,对于许多编程概念/术语,例如 应用程序编程接口:

什么是 API?

<块引用><块引用>

应用程序编程接口 (API) 是一组特定的规则(代码")和规范,软件程序可以遵循这些规则来相互通信.它充当不同软件程序之间的接口并促进它们之间的交互,类似于用户界面促进人机交互的方式.

它是如何使用的?

使用任何一组规则的方式都是一样的.

何时何地使用?

自然而然地取决于领域和 API.考虑这些:

  1. x86 (IA-32) 指令集(非常有用;-)
  2. A BIOS 中断调用
  3. OpenGL,通常作为 C 库公开
  4. 核心 Windows 系统调用:WinAPI
  5. Ruby 核心库中的类和方法
  6. 浏览器向 JavaScript 公开的文档对象模型
  7. 网络服务,例如由 Facebook 的图谱 API
  8. 一个协议的实现,例如Java 中的JNI

快乐编码.

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天全站免登陆