从RPC到WCF和JAX-WS
上一篇 /
下一篇 2007-04-28 10:49:17
讨论完UGC的功能目标以后,4月份主要在作基于UGC的系列产品的架构设计,包括组件和服务器产品的设计。现在大家显然都看到了今后较长一段时间内,面向服务的软件设计架构和分布式的计算是主流。所以我们就在想SuperMap Objects.Net是否都需要设计成remoting对象,都可供远程调用呢?现在不少产品都是已经这样设计,服务器对象的概念确实很迷人。所以我们开始深入研究分布式计算技术。最开始分布式计算是由操作系统实现的,在那个OS辈出的时代,很重要的一种操作系统就是分时操作系统,一个服务器,很多终端登录上去。 但这种模式基本上是共享服务器资源,终端基本没有计算能力,实质上还是集中计算模型。后来出现了RPC,也就是远程过程调用(Remote Procedure Call),就是在宿主机器上启动一个服务,能够响应远程的一个请求,执行相应的处理,就像调用本地的程序一样。最初的RPC比较类似C语言的函数调用,随着编程语言和技术的发展,特别是面向对象和组件技术的应用,出现了远程对象调用。如DCOM和COM+,CORBA、Java RMI,以及在.NET中出现的.NET Remoting技术。这几个技术我觉得本质上都是RPC调用,只是使用面向对象的方式进行了封装以及通讯协议的区别,实现者试图把远程对象和本地对象的区别隐藏起来,让使用者就像使用本地对象那样使用远程对象。但是远程对象调用实现以后,也暴露出一些弊端,如由于历史原因,封装远程对象往往参考本地对象设计,调用的颗粒度小,频繁的与服务交互导致效率较低,如对象的状态管理问题,对象的生命周期管理问题,事务管理等。所以出现了面向服务架构(SOA)的设计。而微软的WCF(indigo),统一远程对象调用和SOA,把两者的编程模型统一,不难看出,微软在向后兼容和向前发展方面的考虑。
Java方面,应对WCF技术推出了相应的一个SCA(Service Component Architecture)架构,但Sun没有参与,而是继续发展JAX-WS标准。所以未来的走向有点模糊,还需要进一步的了解才能明了。
纵观IT业界,趋势已经比较明了,大家都趋向于面向服务设计,提供服务型的方法,并以面向对象的方式来封装,并设计比较大的"large document-oriented parameters"来调用服务,减少与服务器的交互次数。
以下是一些相关的材料:
WCF and location transparency
In the past, distributed computing technologies such as DCOM or .NET Remoting aspired to provide the same programming model to the client whether the object was local or remote. In the case of a local call, the client used a direct reference, and when dealing with a remote object, the client used a proxy. The problem with this approach of trying to take the local programming model and make it the remote programming model is that there is much more to a remote call than an object with a wire. Complex issues such as life cycle management, reliability, state management, scalability, and security raised their heads, making the remote programming model significantly more complex, all because it tried to be what it is nota local object. WCF also strives to provide the client with the same programming model regardless of the location of the service. However, the WCF approach is the exact opposite: it takes the remote programming model of instantiating and using a proxy and uses it even in the most local case. Because all interactions are done via a proxy, requiring the same configuration and hosting, WCF maintains the same programming model for the local and remote cases; thus it not only enables you to switch locations without affecting the client, but also significantly simplifies the application programming model.
作者Juval Lowy 使用过COM,.NET多年,还曾经撰写过《COM与.NET组件服务COM and .NET Component Services》等书籍,对他的介绍请参看http://www.baidu.com/s?wd=Juval+Lowy&cl=3。
SCA WhitePaper:
SCA aims to simplify the creation and integration of business applications built using
a Service Oriented Architecture (SOA). In an SOA, relatively coarse-grained business
components are exposed as services, with well-defined interfaces and contracts.
Interfaces are expressed using technology agnostic business terms and concepts.
“Coarse grained” here means that the service interfaces use relatively few service
methods to achieve a particular business goal, with large document-oriented
parameters.
导入论坛
收藏
分享给好友
管理
举报
TAG:
服务
SOA
WCF
RPC