2.1Chapter Overview
In this chapter, we present a high-level overview of the Ice architecture.
Section 2.2 introduces fundamental concepts and terminology, and outlines how
Slice definitions, language mappings, and the Ice run time and protocol work in
concert to create clients and servers. Section 2.3 briefly presents the object
services provided by Ice, and Section 2.4 outlines the benefits that result from the
Ice architecture. Finally, Section 2.5 presents a brief comparison of the Ice and
CORBA architectures.
在這一章里,我們將呈現一個(gè)ICE架構的高層預覽。2.2節將介紹一些基礎的概念和術(shù)語(yǔ),并概括一下Slice是如何定義的,語(yǔ)言是如何映射的,還有Ice運行時(shí)和協(xié)議在創(chuàng )建客戶(hù)端和服務(wù)器時(shí)是如何保持一致的。2.3節簡(jiǎn)要的介紹一下ICE提供的對象服務(wù)。在2.4節概括一下由ICE架構所帶來(lái)的好處。最后,在2.5節將提供一個(gè)ICE和CORBA架構的一個(gè)大概的比較。
2.2The Ice Architecture
Ice is an object-oriented middleware platform. Fundamentally, this means that Ice provides tools, APIs, and library support for building object-oriented client–server applications. Ice applications are suitable for use in heterogeneous environments: client and server can be written in different programming languages, can run on different operating systems and machine architectures, and can communicate 10 Ice Overview using a variety of networking technologies. The source code for these applications is portable regardless of the deployment environment.
ICE是一個(gè)面向對象的中間件平臺。從根本上講,這意味著(zhù)ICE提供了一些工具、API和庫用以開(kāi)發(fā)面向對象的客戶(hù)端-服務(wù)器的應用程序。ICE應用程序適合于用在各種異構的環(huán)境中:客戶(hù)端和服務(wù)器可以用不同的語(yǔ)言編寫(xiě),能夠運行在不同的操作系統、不同體系結構的機器上,可以用不同的網(wǎng)絡(luò )技術(shù)進(jìn)行通訊(大概10種以上)。這些程序的源代碼可以在不同的開(kāi)發(fā)環(huán)境之間移植。
Every computing technology creates its own vocabulary as it evolves. Ice is no exception. However, the amount of new jargon used by Ice is minimal. Rather than inventing new terms, we have used existing terminology as much as possible. If you have used another middleware technology, such as CORBA, in the past, you will be familiar with most of what follows. (However, we suggest you at least skim the material because a few terms used by Ice do differ from the corresponding CORBA terminology.)
任何一個(gè)計算機技術(shù)在它的發(fā)展過(guò)程中都會(huì )創(chuàng )造一些術(shù)語(yǔ)。ICE也不例外。但是,ICE所用的新術(shù)語(yǔ)是最少的。我們盡可能的用一些已經(jīng)存在的術(shù)語(yǔ),而不是發(fā)明新的。如果你以前用過(guò)其他的中間件產(chǎn)品的話(huà),例如CORBA,你對下面的很多術(shù)語(yǔ)可能已經(jīng)熟悉了。(但是,我們建議你至少要掌握一些重要的東西,因為有一些術(shù)語(yǔ)在ICE中與在CORBA中的意思不同)
Clients and Servers
The terms client and server are not firm designations for particular parts of an
application; rather, they denote roles that are taken by parts of an application for
the duration of a request:
• Clients are active entities. They issue requests for service to servers.
• Servers are passive entities. They provide services in response to client
requests.
l 客戶(hù)端和服務(wù)器
客戶(hù)端和服務(wù)器不是指應用程序的固定的某一方。相反,它們是指在應用程序請求期間某一方所扮演的角色。
客戶(hù)端是主動(dòng)的實(shí)體。它們向服務(wù)器發(fā)出服務(wù)請求。
服務(wù)器是被動(dòng)的實(shí)體。它們向客戶(hù)端提供服務(wù)。
Frequently, servers are not “pure” servers, in the sense that they never issue
requests and only respond to requests. Instead, servers often act as a server on
behalf of some client but, in turn, act as a client to another server in order to
satisfy their client’s request.
服務(wù)器并不總是一個(gè)“純粹的”服務(wù)器(所謂“純粹的”服務(wù)器是指它們從來(lái)不發(fā)送請求,只是回應請求)。通常情況下是這樣,服務(wù)器相對自己的客戶(hù)端時(shí)是服務(wù)器,但是,為了滿(mǎn)足其客戶(hù)端的請求,它們可能會(huì )是其他服務(wù)器的客戶(hù)端。
Similarly, clients often are not “pure” clients, in the sense that they only
request service from an object. Instead, clients are frequently client–server
hybrids. For example, a client might start a long-running operation on a server; as
part of starting the operation, the client can provide a callback object to the server
that is used by the server to notify the client when the operation is complete. In
that case, the client acts as a client when it starts the operation, and as a server
when it is notified that the operation is complete.
同樣的,客戶(hù)端也不總是一個(gè)“純粹的”的客戶(hù)端(所謂“純粹的”的客戶(hù)端是指只是從一個(gè)對象中請求服務(wù))。相反,客戶(hù)端經(jīng)常是一個(gè)客戶(hù)端-服務(wù)器的混合體。例如,一個(gè)客戶(hù)端可能會(huì )在服務(wù)器上啟動(dòng)一個(gè)長(cháng)時(shí)間的操作,在啟動(dòng)這個(gè)操作時(shí),客戶(hù)端可能會(huì )向服務(wù)器提供一個(gè)回調對象,服務(wù)器可以在完成操作時(shí)用這個(gè)對象通知客戶(hù)端。在這種情況下,客戶(hù)端在啟動(dòng)操作時(shí)是一個(gè)客戶(hù)端,在指定的操作完成被通知時(shí)是一個(gè)服務(wù)器。
Such role reversal is common in many systems, so, frequently, client–server
systems could be more accurately described as peer-to-peer systems.
這樣的角色互換在很多系統中是很普通的,所以,一個(gè)客戶(hù)端-服務(wù)器系統常常被精確的描述為一個(gè)PtoP系統。
聯(lián)系客服