📄 200604241155005.html
字号:
<html>
<head><title>中间件</title></head>
<center><h1>中间件</h1></center>
<div><DIV>
<P align=right><FONT face=Verdana><FONT face=Verdana><FONT face=黑体 color=#ff0033><FONT face=Verdana><FONT color=#f70938><FONT face=黑体><a href="200604112229525.html" tppabs="http://www.itisedu.com/phrase/200604112229525.html" target="_new">中科永联</a>高级技术培训中心(</FONT><FONT face=黑体>www.itisedu.com</FONT><FONT face=黑体>)</FONT></FONT></FONT><IMG src="2006321215557495.jpg" tppabs="http://www.itisedu.com/manage/Upload/image/2006321215557495.jpg" border=0></FONT></FONT></FONT></P>
<P><FONT face=Verdana> <FONT face=Verdana><a href="200604241155005.html" tppabs="http://www.itisedu.com/phrase/200604241155005.html" target="_new">中间件</a>(<a href="javascript:if(confirm('http://www.itisedu.com/phrase/200604241155235.html \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?'))window.location='http://www.itisedu.com/phrase/200604241155235.html'" tppabs="http://www.itisedu.com/phrase/200604241155235.html" target="_new">middleware</a>)是一种独立的系统<a href="200604232134205.html" tppabs="http://www.itisedu.com/phrase/200604232134205.html" target="_new">软件</a>或服务<a href="200604232224305.html" tppabs="http://www.itisedu.com/phrase/200604232224305.html" target="_new">程序</a>,分布式应用软件借助这种软件在不同的技术之间共享资源,中间件位于客户机服务器的<a href="200602281634075.html" tppabs="http://www.itisedu.com/phrase/200602281634075.html" target="_new">操作系统</a>之上,管理计算资源和网络通信。</FONT>中间件(middleware)是基础软件的一大<a href="200603090857555.html" tppabs="http://www.itisedu.com/phrase/200603090857555.html" target="_new">类</a>,属于可复用软件的范畴。顾名思义,中间件处于操作系统软件与用户的应用软件的中间。中间件在操作系统、网络和<a href="200602271218062.html" tppabs="http://www.itisedu.com/phrase/200602271218062.html" target="_new">数据库</a>之上,应用软件的下层,总的作用是为处于自己上层的应用软件提供运行与开发的环境,帮助用户灵活、高效地开发和集成复杂的应用软件。</FONT></P>
<P><FONT face=Verdana> 在中间件产生以前,应用软件直接使用操作系统、网络协议和数据库等开发,这些都是<a href="200603021438435.html" tppabs="http://www.itisedu.com/phrase/200603021438435.html" target="_new">计算机</a>最底层的东西,越底层越复杂,开发者不得不面临许多很棘手的问题,如操作系统的多样性,繁杂的网络<a href="200602281641255.html" tppabs="http://www.itisedu.com/phrase/200602281641255.html" target="_new">程序设计</a>、管理,复杂多变的网络环境,数据分散处理带来的不一致性问题、性能和效率、安全,等等。这些与用户的业务没有直接关系,但又必须解决,耗费了大量有限的时间和精力。于是,有人提出能不能将应用软件所要面临的共性问题进行提炼、抽象,在操作系统之上再形成一个可复用的部分,供成千上万的应用软件重复使用。这一技术思想最终构成了中间件这类的软件。</FONT></P>
<P align=left><FONT face=Verdana> 为解决分布异构问题,人们提出了中间件(middleware)的概念。中间件是位于平台(硬件和操作系统)和应用之间的通用服务,如图1所示,这些服务具有标准的程序接口和协议。针对不同的操作系统和硬件平台,它们可以有符合接口和协议规范的多种实现。 </FONT></P>
<P align=center><FONT face=Verdana><IMG src="2006227134151616.jpg" tppabs="http://www.itisedu.com/manage/Upload/image/2006227134151616.jpg" border=0></P>
<P align=left><BR> <BR> 图1 中间件</P>
<P align=left></FONT><FONT face=Verdana><BR> 也许很难给中间件一个严格的定义,但中间件应具有如下的一些特点:</P>
<P> 满足大量应用的需要<BR> 运行于多种硬件和<a href="200604232131175.html" tppabs="http://www.itisedu.com/phrase/200604232131175.html" target="_new">OS</a>平台<BR> 支持分布计算,提供跨网络、硬件和OS平台的透明性的应用或服务的交互<BR> 支持标准的协议<BR> 支持标准的接口</P>
<P> 由于标准接口对于可移植性和标准协议对于互操作性的重要性,中间件已成为许多标准化工作的主要部分。对于应用<a href="200603282233345.html" tppabs="http://www.itisedu.com/phrase/200603282233345.html" target="_new">软件开发</a>,中间件远比操作系统和网络服务更为重要,中间件提供的程序接口定义了一个相对稳定的高层应用环境,不管底层的<a href="javascript:if(confirm('http://www.itisedu.com/phrase/200602281616335.html \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?'))window.location='http://www.itisedu.com/phrase/200602281616335.html'" tppabs="http://www.itisedu.com/phrase/200602281616335.html" target="_new">计算机硬件</a>和系统软件怎样更新换代,只要将中间件升级更新,并保持中间件对外的接口定义不变,应用软件几乎不需任何修改,从而保护了企业在应用软件开发和维护中的重大投资。</P>
<P><FONT face=Verdana><STRONG>一、中间件的历史</STRONG></FONT></P>
<P><FONT face=Verdana>最早具有中间件技术思想及功能的软件是IBM的CICS,但由于CICS不是分布式环境的产物,因此人们一般把Tuxedo作为第一个严格意义上的中间件产品。Tuxedo是1984年在当时属于AT&AMp;&T的贝尔实验室开发完成的,但由于分布式处理当时并没有在商业应用上获得像今天一样的成功,Tuxedo在很长一段时期里只是实验室产品,后来被Novell收购,在经过Novell并不成功的商业推广之后,1995年被现在的BEA公司收购。尽管中间件的概念很早就已经产生,但中间件技术的广泛运用却是在最近10年之中。BEA公司1995年成立后收购Tuxedo才成为一个真正的中间件厂商,IBM的中间件MQSeriES也是90年代的产品,其它许多中间件产品也都是最近几年才成熟起来。</FONT></P>
<P><STRONG>二、为什么要中间件</STRONG></P>
<P> 计算机技术迅速发展。从硬件技术看,CPU速度越来越高,处理能力越来越强;从软件技术看,应用程序的规模不断扩大,特别是Internet及WWW的出现,使计算机的应用范围更为广阔,许多应用程序需在网络环境的异构平台上运行。这一切都对新一代的软件开发提出了新的<a href="200603101518295.html" tppabs="http://www.itisedu.com/phrase/200603101518295.html" target="_new">需求</a>。在这种分布异构环境中,通常存在多种硬件系统平台(如PC,工作站,小型机等),在这些硬件平台上又存在各种各样的系统软件(如不同的操作系统、数据库、语言编译器等),以及多种风格各异的用户界面,这些硬件系统平台还可能采用不同的网络协议和网络<a href="javascript:if(confirm('http://www.itisedu.com/phrase/200603122156385.html \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?'))window.location='http://www.itisedu.com/phrase/200603122156385.html'" tppabs="http://www.itisedu.com/phrase/200603122156385.html" target="_new">体系结构</a>连接。如何把这些系统集成起来并开发新的应用是一个非常现实而困难的问题。<BR> <BR><STRONG>三、主要中间件的分类</STRONG></P>
<P> <FONT face=Verdana>中间件分类(IDC的分类):大致可分为六类:终端仿真/屏幕转换中间件、数据访问中间件、<a href="javascript:if(confirm('http://www.itisedu.com/phrase/200604241405415.html \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?'))window.location='http://www.itisedu.com/phrase/200604241405415.html'" tppabs="http://www.itisedu.com/phrase/200604241405415.html" target="_new">远程过程调用</a>中间件、<a href="200603090938465.html" tppabs="http://www.itisedu.com/phrase/200603090938465.html" target="_new">消息</a>中间件、交易中间件、<a href="200603090845215.html" tppabs="http://www.itisedu.com/phrase/200603090845215.html" target="_new">对象</a>中间件。</FONT></P>
<P> 中间件所包括的范围十分广泛,针对不同的应用需求涌现出多种各具特色的中间件产品。但至今中间件还没有一个比较精确的定义,因此,在不同的角度或不同的层次上,对中间件的分类也会有所不同。由于中间件需要屏蔽分布环境中异构的操作系统和网络协议,它必须能够提供分布环境下的通讯服务,我们将这种通讯服务称之为平台。基于目的和实现机制的不同,我们将平台分为以下主要几类:</P>
<P> 远程过程调用中间件(Remote Procedure Call)<BR> 面向消息的中间件(MesSAge-Oriented Middleware)<BR> 对象请求代理中间件(<a href="javascript:if(confirm('http://www.itisedu.com/phrase/200604231338435.html \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?'))window.location='http://www.itisedu.com/phrase/200604231338435.html'" tppabs="http://www.itisedu.com/phrase/200604231338435.html" target="_new">object</a> RequeST Brokers)</P>
<P> 它们可向上提供不同形式的通讯服务,包括同步、排队、订阅发布、广播等等,在这些基本的通讯平台之上,可构筑各种<a href="200603061723295.html" tppabs="http://www.itisedu.com/phrase/200603061723295.html" target="_new">框架</a>,为应用程序提供不同领域内的服务,如事务处理监控器、分布数据访问、对象事务管理器OTM等。平台为上层应用屏蔽了异构平台的差异,而其上的框架又定义了相应领域内的应用的系统结构、标准的服务<a href="200603302222545.html" tppabs="http://www.itisedu.com/phrase/200603302222545.html" target="_new">组件</a>等,用户只需告诉框架所关心的事件,然后提供处理这些事件的代码。当事件发生时,框架则会调用用户的代码。用户代码不用调用框架,用户程序也不必关心框架结构、执行流程、对系统级<a href="javascript:if(confirm('http://www.itisedu.com/phrase/200604241228185.html \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?'))window.location='http://www.itisedu.com/phrase/200604241228185.html'" tppabs="http://www.itisedu.com/phrase/200604241228185.html" target="_new">API</a>的调用等,所有这些由框架负责完成。因此,基于中间件开发的应用具有良好的可扩充性、易管理性、高可用性和可移植性。</P>
<P> 下面,针对几类主要的中间件分别加以简要的介绍。</P>
<P>1、远程过程调用</P>
<P> 远程过程调用是一种广泛使用的分布式应用程序处理方法。一个应用程序使用RPC来“远程”执行一个位于不同地址空间里的过程,并且从效果上看和执行本地调用相同。事实上,一个RPC应用分为两个部分:server和<a href="javascript:if(confirm('http://www.itisedu.com/phrase/200604231337375.html \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?'))window.location='http://www.itisedu.com/phrase/200604231337375.html'" tppabs="http://www.itisedu.com/phrase/200604231337375.html" target="_new">Client</a>。server提供一个或多个远程过程;client向server发出远程调用。server和client可以位于同一台计算机,也可以位于不同的计算机,甚至运行在不同的操作系统之上。它们通过网络进行通讯。相应的stub和运行支持提供数据转换和通讯服务,从而屏蔽不同的操作系统和网络协议。在这里RPC通讯是同步的。采用<a href="200603091754305.html" tppabs="http://www.itisedu.com/phrase/200603091754305.html" target="_new">线程</a>可以进行异步调用。</P>
<P> 在RPC模型中,client和server只要具备了相应的RPC接口,并且具有RPC运行支持,就可以完成相应的互操作,而不必限制于特定的server。因此,RPC为client/server分布式计算提供了有力的支持。同时,远程过程调用RPC所提供的是基于过程的服务访问,client与server进行直接连接,没有中间机构来处理请求,因此也具有一定的局限性。比如,RPC通常需要一些网络细节以定位server;在client发出请求的同时,要求server必须是活动的等等。</P>
<P>2、面向消息的中间件</P>
<P> MOM指的是利用高效可靠的消息传递机制进行平台无关的数据交流,并基于数据通信来进行分布式系统的集成。通过提供消息传递和消息排队模型,它可在分布环境下扩展进程间的通信,并支持多通讯协议、语言、应用程序、硬件和软件平台。目前流行的MOM中间件产品有IBM的MQSeries、BEA的MessageQ等。消息传递和排队技术有以下三个</P>
<P> 主要特点:<BR> 通讯程序可在不同的时间运行 程序不在网络上直接相互通话,而是间接地将消息放入消息队列,因为程序间没有直接的联系。所以它们不必同时运行。消息放入适当的队列时,目标程序甚至根本不需要正在运行;即使目标程序在运行,也不意味着要立即处理该消息。</P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -