RMI与Web服务. Java2Java远程处理的最佳方法是什么? [英] RMI vs. Web Services. What's best for Java2Java remoting?

查看:75
本文介绍了RMI与Web服务. Java2Java远程处理的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Web服务和RMI的新手,我想知道当这些应用程序全部用Java编写时,即不同的编程语言无关紧要时,哪种方法是在不同的Web应用程序之间进行远程处理的更好方法.将是WS的优势.)

I'm new to both Web Services and RMI and I wonder which is the better way to do remoting between different web applications, when these applications are all written in Java, that is when different programming languages don't matter (which would be the advantage of WS).

一方面,我猜想在使用Web服务时会有性能开销(有人能证明这一点吗?),另一方面,在我看来,Web服务之间的耦合要松散得多,并且可以用于实现更面向服务的体系结构(SOA)(RMI无法实现,对吧?).

While on the one hand I would guess that there's a performance overhead when using web services (does anyone have some numbers to prove that?), on the other hand it seems to me that web services are much more loosely coupled and can be used to implement a more service-oriented architecture (SOA) (which isn't possible with RMI, right?).

尽管这是一个很普遍的问题,您对此有何看法?

Although this is quite a general question, what's your opinion?

谢谢

推荐答案

Web服务确实允许使用松散耦合的体系结构.使用RMI,您必须确保所有应用程序实例中的类定义都保持同步,这意味着即使只更改了其中一个,您也必须始终同时部署所有它们.由于串行UUID等原因经常需要)

The web services do allow a loosely coupled architecture. With RMI, you have to make sure that the class definitions stay in sync in all application instances, which means that you always have to deploy all of them at the same time even if only one of them is changed (not necessarily, but it is required quite often because of serial UUIDs and whatnot)

而且它的伸缩性不是很好,如果您想要负载平衡器,则可能是个问题.

Also it is not very scalable, which might be an issue if you want to have load balancers.

在我看来,RMI最适合与本地无关的小型本地应用程序,这些应用程序与Internet无关,但仍需要解耦.我已经使用它来处理一个处理电子通信的Java应用程序,并且对结果非常满意.对于需要更复杂的部署并可以在Internet上运行的其他应用程序,我宁愿使用Web服务.

In my mind RMI works best for smaller, local applications, that are not internet-related but still need to be decoupled. I've used it to have a java application that handles electronic communications and I was quite satisfied with the results. For other applications that require more complex deployment and work across the internet, I rather use web services.

这篇关于RMI与Web服务. Java2Java远程处理的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆