This article provided some descriptions of the API, along with some sample code to illustrate how to make use of them.
这篇文章提供了应用程序编程接口的一些描述以及一些样本代码来阐明如何使用他们。
If you cannot change the original API, you can write wrapper code to convert the collection type into an array.
如果您不能改变原始的API,那么您可以书写封装器代码,将聚集类型转化为数组。
If you code your API against one server and treat it as if it is the reference implementation, you've made an assumption that other implementations are going to operate the same way.
如果您针对一个服务器编码您的API并将其视为参考实现,那么您就等于做出了这样一个假设:其他实现将以相同的方式运行。
This type of driver code maps directly to a high level native API.
这类驱动程序的代码直接与高级本机api形成映射。
For illustration purposes, let's take a look at the bridge code generated for a simple COM API example.
为了展示这个过程,让我们来看一看为一个简单的COMAPI示例生成的桥代码。
They are visual imaginings built from the raw stuff of computer programming - disassembled code, API calls, memory addresses and subroutines.
它们是从计算机程序设计原料——反汇编代码、API调用、内存地址和子程序创建而来的视觉想像。
The code review engine provides a simple API for this.
代码评审引擎为这一操作提供了一个简单的API。
To illustrate the read-first technique, I'll start with some code that implements the API Layer transaction strategy.
为了演示这种先读取技巧,我们从一些实现api层事务策略的代码入手。
The generated API allows developers to code the implementation in a way that does not depend on any technology decisions: the generated API hides those from the component implementation code.
生成的API允许开发人员用一种不依赖于任何技术决策的方法对实现进行编码:生成的API隐藏了组件实现代码的相关内容。
These complex features can be implemented by the ODFDOM API, though the code might be complex.
这些复杂的特性可以通过ODFDOMAPI实现,尽管代码会很复杂。
Additionally, code written to the JDBC 1 API that USES the previously deprecated methods will continue to work.
另外,使用以前那些遭反对的方法写进JDBC1API的代码也可以继续运行。
Here's some code that illustrates how the API can be used.
下面是一些范例代码,它们演示了可以使用API的方式。
Essentially, security administrators can code to the GSS-API and implement virtually any supported security mechanism that supports this interface.
本质上是,安全管理员可以对于GSS -API进行编码,并真正实现支持该接口的、受支持的安全机制。
This way your code isn't tied to any particular XML handling API.
这样你的代码就不依赖任何特殊的XML处理API了。
Figure 3 shows the output from running the API code from the command line.
图3展示了通过命令行运行API代码的输出结果。
Make code reuse easier because of a consistent API.
使代码重用更容易,因为有一个统一的API。
It enabled a common means for developers to code to one API regardless of the database.
它实现了一种通用的方式,使开发人员对一种API编码,而不必考虑数据库的类型。
Private API: The rules in this category focus on finding instances within your code where a private API has been accessed.
私有API:这个类别中的规则专注于找出你的代码中访问了私有API的实例。
Let's look at the new API, and we'll follow with some example code.
让我们查看一下新的API,然后接下来是一些范例代码。
In order to build a middleware bridge between the front-end CGI display code and the back-end database and business logic code, an API that allows all necessary data access must be defined.
为了在前端CGI显示代码和后端数据库及业务逻辑代码之间构建一个中间件桥,必须定义一个允许所有必需数据访问的API。
If calling code ignored the API and manipulated data structures in the library code, this independence would be lost since a change in the library's implementation might break the misbehaving client.
如果调用代码忽略api并处理库代码中的数据结构,那么将丧失这种独立性,因为库实现中的改变可能破坏行为失常的客户端。
Now that you understand how the API works, let's look at some code.
理解了API的工作方式后,我们来看一些代码。
The following code fragment is a typical setup step required for code which USES the publish API.
下面的代码片段是使用发布api的代码所需的典型的设置步骤。
The code in Listing 1 defines the API.
清单1中的代码定义了API。
The code for the publisher is identical to that of the point-to-point application, because the JMS 1.1 API enables JMS code that can produce messages onto either a queue or a topic.
发布者的代码与点到点应用程序的对应项完全一样,这是因为JMS 1.1API允许使用可以产生发布到队列和主题的消息的JMS代码。
The situation is similar to what you'd see in JDBC client code, wherein the API applies directly to the relational model.
这种情况与JDBC客户端代码相似,其中API直接应用到关系模型。
The generated client code USES the EJB API to interact with tasks and processes; the EJB methods that are called by the generated client code use late binding.
生成的客户端代码使用EJBAPI与任务和流程交互;生成的客户端代码所调用的EJB方法使用后期绑定。
The implementation code is written against the generated API code explained above.
实现代码可以针对之前介绍的生成的API代码来编写。
Listing 2 shows the source code clips of using the SCSI generic API.
清单2显示了使用SCSI通用API的源代码片段。
When you test, you want to make sure that your code uses an API correctly.
在测试时,需要确保代码能正确使用API。
应用推荐