platform 和 api 这两个词到底是什么意思?

发布于 2024-08-17 04:38:38 字数 156 浏览 5 评论 0原文

我买了一本“学习java SE 6平台”的书。我想知道平台这个词的真正含义是什么。因为它不只是我可以使用的一堆类。 Netbeans 中 Libraries 下的 JDK 1.6 节点。

什么是API?这和平台不是一回事吗?但是库不是意味着同样的事情吗……一堆带有一些超类的类等等?

i've bought a book "learning the java SE 6 platform". i wonder what the word platform really means. cause isn't it just a bunch of classes that i can use. the JDK 1.6 node in Netbeans under Libraries.

And what is API? isn´t it the same thing as platform. But doesnt library mean the same thing..a bunch of classes with some superclasses and so on?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

沦落红尘 2024-08-24 04:38:38

术语“平台”用于表示在特定上下文中被视为给定的任何软件、服务和资源的集合,因此它们可以用作应用程序软件的构建块(或在之上构建更高级别的平台) API 是应用程序编程接口的

缩写。这通常意味着应用程序(您正在编写的程序)可以使用调用约定(函数签名等)来细读库或平台内的功能的集合。

API 与库不同 - 术语“接口”表示它仅指定您可以调用的内容及其行为方式。实现接口的实际库可以自行决定如何提供指定的功能。

API 的一个很好的例子是 JDBC API - 这是 java 程序与数据库通信的标准方式。每个数据库供应商都有自己的协议用于连接到数据库、将变量等绑定到数据库命令,但 JDBC API 抽象了所有这些并定义了一个共同点,允许所有 java 程序使用同一组函数进行通信 - 理想情况下- 任何数据库。数据库供应商的工作是实际提供驱动程序,即实现一个符合 API 的库,并知道它如何为特定数据库系统完成其任务。因此,在这种情况下,您有许多驱动程序库(每个供应商都有自己的,有时是多个驱动程序库),但它们都通过 API 指定的同一组函数、类等来提供功能(在本例中为 JDBC API - 请参阅http://java.sun.com /j2se/1.5.0/docs/api/java/sql/package-summary.html

有时,API 非常广泛,以至于它被视为一个平台,但术语“平台”更通用,平台并不例如,标准 UNIX 实用程序(如 ls、grep、cd 等)的集合可以被视为一个平台,但与其说是一个 API,不如说是一个 API。

The term "platform" is used to denote any collection of software, services and resources that, within a specific context, are considered a given so they can be used as building blocks for application software (or to build a higher level platform on top of that - something considered a platform in another context)

API is an acronym for application programming interface. This usually means the collection of calling conventions (function signatures and the like) that can be used by an application (the program you are writing) for perusing functionality residing inside a library or a platform.

An API is not the same as a library - the term Interface conveys that it only specifies what you can call, and how that behaves. The actual library that implements the interface can decide for itself how it delivers the specified functionality.

A good example of an API is for example the JDBC API - this is the standard way for java programs to communicate with databases. Each database vendor has its own protocol for connecting to the database, binding variables and such to database commands, but the JDBC API abstracts all that and defines a common ground what allows all java programs to use the same set of functions to talk to - ideally - any database. It is the database vendor's job to actually provide a driver, that is, implement a library that is in accordance with the API and knows how it can fulfill its tasks for that particular database system. So in this case you have many driver libraries (each vendor has their own, sometimes multiple ones) but they all deliver their functionality through the same set of functions, classes etc. specified by the API (in this case, the JDBC API - see http://java.sun.com/j2se/1.5.0/docs/api/java/sql/package-summary.html

Sometimes, an API is so extensive that it is considered a platform, but the term platform is more general, a platform does not need to be an API. For example, the collection of standard UNIX utilities like ls, grep, cd etc. can be considered a platform, but not so much an API.

失眠症患者 2024-08-24 04:38:38

Java 平台(大致)由以下部分组成:

  1. Java 编程语言
  2. Java API
  3. Java 虚拟机

关于 Java(软件平台)的维基百科文章

API(或应用程序编程接口)单独提供了 Java 平台附带的类。例如,当人们说“Java API”时,人们可能会指的是 附带的类库Java SE 平台。

只是为了提供链接,这里是 Java 平台各个部分的官方文档:

The Java platform consists (roughly) of the following:

  1. The Java programming language
  2. The Java API
  3. The Java Virtual Machine

There's a quite a bit of details in the Wikipedia article on Java (software platform).

The API, or application programming interface, alone provides the classes that come with the Java platform. For example, when one says the "Java API", one would probably be referring to the class libraries which come with the Java SE platform.

Just for the sake of providing links, here are the official documentation for each part of the Java platform:

信仰 2024-08-24 04:38:38

API - 是一个应用程序编程接口 - 这是一组可供使用的类。
平台是一个完整的捆绑包 - API 与运行时和附加应用程序(如编译器等)。

API - is a Application Programming Interface - this is a set of classes for use.
Platform is a whole bundle - API with runtime and additional applications like compiler, ect.

夏见 2024-08-24 04:38:38

是的,平台更多的是一个通用术语,在不同的上下文中可能意味着不同的东西。想象一下像 Xbox 这样的游戏平台。在这种情况下,微软为开发者制作游戏以及人们玩游戏提供了一个“平台”。

就 J2EE(企业 Java)而言,平台一词对我来说意味着开发人员构建企业应用程序的解决方案。正如您所指出的,它不仅仅是一组课程。例如,有很多规范,如 JPA(用于持久性)、EJB 等。在这些情况下,Java 开发人员已经制定了规范供其他供应商实现。我认为平台是一个提供各种服务的基础,可以在此基础上构建更伟大的东西。

API 是一个技术性更强、更精确的术语。它代表应用程序编程接口。 API是我们开发人员在使用别人的软件时使用的接口。考虑一个 Java String 类。它有一个 length() 方法。所有 Jave 开发人员都知道 String 类存在此方法,因此它是 Java API 的一部分。

Yeah platform is more of a general term that can mean different things in different contexts. Think of a gaming platform like the XBox. In this case Microsoft provides a "platform" for developers to make games, and for people to play games on.

In the case of J2EE (enterprise Java), the term platform to me means a solution for developers to build enterprise applications. Its more than a set of classes as you pointed out. For example there are plenty of specifications such as JPA (for persistence), EJB etc. In these cases the Java developers have laid out a specification for other vendors to implement. I think of platform as a base that provides a variety of services on which to build something greater.

An API is a more technical a precise term. It stands for Application Programming Interface. An API is the interface that we developers use when using other people's software. Think of a Java String class. It has a length() method. All Jave developers know that this method exists for the String class, and it is thus part of the Java API.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文