為什麼術語 API 和 SDK 似乎可以互換使用? (Why do the terms API and an SDK seem to be used interchangeably?)


問題描述

為什麼術語 API 和 SDK 似乎可以互換使用? (Why do the terms API and an SDK seem to be used interchangeably?)

What is the accepted definition of an API compared to the definition of an SDK? Both seem to be used interchangeably, so I'd imagine that some libraries dubbed APIs are in reality SDKs, and vice versa. Also, is there a reason for this distinction?

Thanks!


參考解法

方法 1:

An API, or application programming interface, defines a set of classes, functions, and structures to be used by an application to make use of some library or subsystem.  For example, both the windows multimedia subsystem, and windows sockets subsystem both have their own API.  An API is not a concrete entity, you can't point at a file and say that the file itself is an API.  An API is merely a specification for a communications protocol that a program needs to use to make use of a library or subsystem.

An SDK, or software development kit, contains tools, documentation, and needed files, to program against 1 or more APIs.  Some SDKs, but by no means all, may contain sample code to demonstrate how an API can be used.  2 examples of an SDK are the Windows Platform SDK and the .NET Framework SDK.

The most likely reason the terms are used interchangeably is because sometimes an SDK only has the tools, documentation, and files for a single API, and both the API and SDK share the same name.  An example of this would be the SDK for developing winamp plugins.

方法 2:

API - Application Programming Interface. This is what you write code to.

SDK - Software Development Kit. These are the libraries that you need so you can code. An SDK likely has many different api's contained in it.

方法 3:

None of the answers I've seen so far really capture it clearly and completely. 

The two terms are not interchangeable and if someone uses them interchangeably, it indicates a lack of understanding or preciseness. 

API - Application Programming Interface. Exposed by a class library. Utilized by an application.  When you build an application that uses the library, this is the interface your code uses to connect to or call into the library. In other words the set of rules and conventions applications must follow to use the library.  The API includes the classes, their methods, the parameter lists for the methods, and other supporting elements (like enumerations, constants and so on). An API is an abstract artifact:  You cannot download an API, or install an API.  You can describe an API, and you can use one.  The library itself is the concrete realization of the API, the delivery mechanism. 

SDK - Software Development Kit. This is a concrete thing.  You can download an SDK, install it, store it.   An SDK includes:

  • libraries, which, as you know, expose or provide APIs.
  • header files (if applicable) 
  • documentation - readme files, help files, release notes, reference documentation, programming guides.  Realized as  .CHM files, pdf documents, etc.
  • tools  - such as compilers, assemblers, linkers, profilers, debuggers, optmizers, test tools, and more.
  • sample code and sample apps - showing how to use the API
  • maybe some other stuff that doesn't fit into one of the above categories

A Concrete Example:  

  • the Java SDK is a downloadable, versioned thing.  It delivers libraries, tools (on windows: javac.exe, java.exe, jar.exe, etc), all the help files and API doc, and source code for the libraries. 
  • the API for Java is the set of rules your code must follow to invoke the libraries; these rules are described in the API documentation. 

方法 4:

An API is an Application Programming Interface -- its something your program can talk to. An SDK usually includes an API along with documentation for the API. An API is not required to contain documentation. An SDK may include the API Components, but will always include the documentation.

(by Mark Carpenteruser109878Byron WhitlockCheesoNate)

參考文件

  1. Why do the terms API and an SDK seem to be used interchangeably? (CC BY-SA 3.0/4.0)

#terminology






相關問題

抽象 ViewModel 在被繼承時是否被視為模型? (Is an abstract ViewModel considered a Model when it is inherited?)

什麼是 Lambda? (What is a Lambda?)

具體確定項目順序的排序的正確術語是什麼? (What is the proper term for an ordering where the order of items is concretely determined?)

在 Ruby 中,“接收者”指的是什麼? (In Ruby what does the "receiver" refer to?)

錯誤跟踪和問題跟踪系統有什麼區別? (What's the difference between a bug tracking and an issue tracking system?)

為什麼術語 API 和 SDK 似乎可以互換使用? (Why do the terms API and an SDK seem to be used interchangeably?)

Java 中的對等類是什麼? (What is a peer class in Java?)

模擬和模擬有什麼區別? (what is the difference between Emulate and Simulate?)

協議術語:消息與數據包 (Protocol Terminology: Message versus Packet)

表示“目錄”或“文件”的詞是什麼? (What is the word that means "directory" or "file"?)

C ++中復合語句和塊之間的區別? (Difference between a compound statement and a block in C++?)

gnu八度中gnu的含義? (Meaning of gnu in gnu octave?)







留言討論