ICE ZEROC文档翻译 (-)

ICE ZEROC文档翻译

Slice Compilation(slice 编译)

Compilation 编译

A Slice compiler produces source files that must be combined with application code to produce client and server executables.

一个slice(文件) 编译产生的源文件一定会被应用代码相连接来产生客户端和服务端的可执行文件.

The outcome of the development process is a client executable and a server executable. These executables can be deployed anywhere, whether the target environments use the same or different operating systems and whether the executables are implemented using the same or different languages. The only constraint is that the host machines must provide the necessary run-time environment, such as any required dynamic libraries, and that connectivity can be established between them.

开发过程中的产生的客户端和服务端可执行文件.这些可执行文件可以在任何地方执行,无论程序的执行环境用的是和开发中的同一个系统还是不同系统(tab == 4 space?) 用的是是同一种语音还是不同的语言.唯一的约束是主机(程序跑的服务器)必须提供必要的jvm,比如各种动态的依赖,执行文件的通信(防火墙?).

Single Development Environment for Client and Server

单服务器开发环境

The figure below shows the situation when both client and server are developed in C++. The Slice compiler generates two files from a Slice definition in a source file Printer.ice: a header file (Printer.h) and a source file (Printer.cpp)
下面的图片就模拟了客户端和服务器端都是用C++开发的情况. Slice(Printer.ice)编译产生一个头文件(Printer.h)和一个源文件(Printer.cpp)
官方原图

Development process if client and server share the same development environment.
如果client和server在同一个开发环境的开发流程

  • The Printer.h header file contains definitions that correspond to the types used in the Slice definition. It is included in the source code of both client and server to ensure that client and server agree about the types and interfaces used by the application.
  • 头文件包括在Slice定义的对应的类型和接口.client 和 server 都被包含在头文件中来确保被应用使用的类型和接口对应上.
  • The Printer.cpp source file provides an API to the client for sending messages to remote objects. The client source code (Client.cpp, written by the client developer) contains the client-side application logic. The generated source code and the client code are compiled and linked into the client executable
  • *Printer.cpp 源文件提供API 给client 让它能够发送消息给远程服务器.客户端源码(client.app,客户端代码 人写的?) 包括了客户端的业务逻辑.生成的client和开发写的client代码一起编译并且关联到client 可执行文件.

The Printer.cpp source file also contains source code that provides an up-call interface from the Ice run time into the server code written by the developer and provides the connection between the networking layer of Ice and the application code. The server implementation file (Server.cpp, written by the server developer) contains the server-side application logic (the object implementations, properly termed servants). The generated source code and the implementation source code are compiled and linked into the server executable.
Printer.cpp源文件也包含了源代码来提供一个通信接口(从ice 跑到 开发人员写的server端) 并且提供ice的网络层到应用(client 端?)的连接.开发人员写的服务端的处理文件(Server.cpp)包括服务端的业务逻辑(负责处理的实体->确切的说servants).生成的源文件和处理代码一起编译生成服务的可执行文件.

Both client and server also link with an Ice library that provides the necessary run-time support.
客户端和服务端一起被ice依赖提供的必要的运行帮助所连接.

You are not limited to a single implementation of a client or server. For example, you can build multiple servers, each of which implements the same interfaces but uses different implementations (for example, with different performance characteristics). Multiple such server implementations can coexist in the same system. This arrangement provides one fundamental scalability mechanism in Ice: if you find that a server process starts to bog down as the number of objects increases, you can run an additional server for the same interfaces on a different machine. Such federated servers provide a single logical service that is distributed over a number of processes on different machines. Each server in the federation implements the same interfaces but hosts different object instances. (Of course, federated servers must somehow ensure consistency of any databases they share across the federation.)
你不在被单个客户端或服务端所限制.例子,你可以开多个服务器.每个都提供相同名字的接口但是用不同的处理方式(举个例子,不同的特性).那么多的服务可以在一个系统中共存.这样的处理提供了一个可扩展机制在Ice中:如果你发现一个服务进程挂了因为内存拉满,你可以加一个服务在另外的服务器上.(支持分布式)这样的集群服务提供了一个单个业务服务分布在不同的机器上.每个服务分布在不同服务器上的相同接口.(当然,分布式服务必须保持数据库的一致性).
Ice also provides support for replicated servers. Replication permits multiple servers to each implement the same set of object instances. This improves performance and scalability (because client load can be shared over a number of servers) as well as redundancy (because each object is implemented in more than one server).
ICE也提供了复制服务.复制每个服务的Object实体.这提供了性能和可伸缩性(因为client可以被几个servers处理)|伸缩性(因为每个实体可以生成多个服务).

Different Development Environments for Client and Server

不同的开发环境(主要原因)重要

Client and server cannot share any source or binary components if they are developed in different languages. For example, a client written in Java cannot include a C++ header file.
客户端和服务端不能用同一个源文件或者二进制文件如果他们用不同的语言写的.举个例子.一个服务用java写的不能包含c++的头文件.

This figure shows the situation when a client written in Java and the corresponding server is written in C++. In this case, the client and server developers are completely independent, and each uses his or her own development environment and language mapping. The only link between client and server developers is the Slice definition each one uses.
下图展示了当一个客户端是用java写的但是对应的服务端使用C++写的.在这种情况下,Client和server的开发人员是相互独立的,并且他们的开发环境和语言各用个的.唯一的连接就是他们用同一个Slice.
官方原图

Development process for different development environments.
用不同环境开发过程

For Java, the slice compiler creates a number of files whose names depend on the names of various Slice constructs. (These files are collectively referred to as *.java in the above figure.)

对java来说,Slice文件编译产生了大量的文件根据不同的Slice结构.(这些文件被统称为*.java在上图)

ICE官方 翻译链接https://doc.zeroc.com/display/Ice37/Slice+Compilation

第一次翻译 敬请谅解

未经本人同意禁止转载等.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值