• Post Reply Bookmark Topic Watch Topic
  • New Topic

Real world example of RMI  RSS feed

 
Barry Andrews
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I am just learning about RMI by reading Sun's tutorial (great article!), and I am finding it very fascinating! What I would like to know is, can someone provide a real world example of how this could be used? Why would this be used as opposed to some other distributed computing method, such as servlet, applet, EJB, etc.? Even though I understand how it works, I guess I am not grasping the concept of how it would be used in the real world. What are the pros and cons? If someone could provide a real world scenario, (the simpler the better) I would greatly appreciate it.
Many thanks,
Barry
 
Osama Bin Drinkin'
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are many real life examples of RMI.For example in a classroom equipped with PC.When the teacher moves his mouse,the mouse cursor is moved on every computer.This is a very simple rral life example.You can find more @ DevShed
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swordfish
Your name does not conform to JavaRanch's naming policy. Please read the policy and change your name appropriately.
Your comment is, how do I put this nicely, grossly misinformed. RMI makes a lot of things possible, but remote window control is not one of them. And your link to DevShed points to nothing on point with your illustration.
I'm trying to decide if I'm offended or not by your cavalier (and totally wrong) answer. Barry seems curious and enthusiastic; he doesn't deserve to be bs'd like this.
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlets, for example, require the use of a servlet engine. This may not be readily available especially if you are invoking a class from one server on your network to another server on your network. Imagine a case where I have a bunch of classes that provide generic services to other classes in my company. I want them to be available to nayone in the company who needs them. I can use RMI so you can invoke them as if they were a class sitting on your server. RMI is free. No servlet engine. No web server. No EJB server. It's very lightweight and simple.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Barry -
RMI's uses are indeed all over the place. It's now a new technology of any sort -- what it does is bring to Java the means to write programs that run in a remote or distributed environment. By remote we mean a client program that asks a server program (on another machine) to perform some kind of work. By distributed we mean a program whose entire process relies on the work of two or more processes working together.
Naturally, there's a little overlap in these terms, but RMI is simply a mean of doing this in Java code. Other models for writing this Kind of code exist: for example, Sun's RPC (Remote Procedure Call) protocol follows a very similar architecture and is a widely accepted standard today. CORBA (Common Object Request Broker Architecture) is an alternative to RMI that is designed to accommodate communication between programs on different platforms and even written in different languages.
Applet code, even though isn't written using RMI, is a good illustration of what's possible using RMI. Virtually any time you need a program to connect to a remote program and get data -- and both programs run in Java -- you might think about using RMI to do it.
 
Barry Andrews
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the great information guys. You have enlightened me in RMI!
Barry
 
Dominic Clay
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael - As I understand it, CORBA is not an alternative to RMI, but an underlying protocol that may or may not be used as a communication layer beneath RMI.
Am I wrong? (quite possible) and how does this fit with the JRMP and IIOP protocols? (IIOP has something to do with CORBA I think...). It is all quite confusing, but I am trying to understand...
Originally posted by Michael Ernest:
[QB]Barry -
CORBA (Common Object Request Broker Architecture) is an alternative to RMI that is designed to accommodate communication between programs on different platforms and even written in different languages.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The underlying protocol for CORBA is IIOP (Internet Inter-Orb Protocol.
I am wondering if 'alternative' is too strong a word, but at one point it was a 'choice' to make between RMI and CORBA, the underlying idea being you're only going to use one or the other. I know there's been a strong effort to make these technologies compatible, even complementary, to each other but I haven't followed it at all.
I don't hate CORBA or anything, I just drew an arbitrary line at CORBA and said, "ok, until I need to know this, it's whatever it is..."
 
Axel Janssen
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
interesting overview material to this RMI-Corba topic was for me Apendixes A, B of Ed Romans "Mastering EJBs". You can get as read-only pdf.
http://www.theserverside.com/books/masteringEJB/index.jsp
(you need to register without fee first)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!