It is very useful example to leaurn RMI.
But it is not easy to use it and I don't know what is different
between RMI and RPC.
I think RPC is more useful, easier and it also supply hetero system
like C or something like that.

(This is a good question.  So I posting the answer to everyone)

As was briefly mentioned in the slide 6 of the RMI presentation, the
fundamental difference between the two is that RMI is completely
based on Java while RPC is not.

Now this has both advantages and disadvantages.  The most distinct
advantage of RMI being completely based on Java platform is "simplified"
programming model. In other words, the RMI client just deals with Java interface
(representing the remote service).  This provides the same benefit you
get when you use Java interface rather than Java classes in any Java
application - the implementation can change without affecting
the client.  In the case of RMI, the stub class (as implementation
class of the interface) gets dynamically loaded from the remote server.

The next important benefit of RMI is so-called "code movement". Because
the client and server runs over Java, the code can be moved around from
the server to the client and from the client and server.  (In RPC, this is
not possible because they might run over different platforms.)  This code
movement can result in a very flexible distributed programming model. Let's
think about a scenario in which you might want to provide
different business logic implementation depending on time of the day, or
business logic, or who the client is. In this case, different implementation of the
same Java interface can be dynamically loaded from the server to the client
based on the factors mentioned.

Now the disadvantage of RMI is also from the fact that it is completely
Java based. It is constrained to be used only over Java-based client and server
while RPC can be used over platforms with different platforms.

-S

--
-------------------------------------------------------------------
             Sang Shin, [email protected]
  Founder and Chief Instructor of JPassion.com (JavaPassion.com)
         http://www.linkedin.com/in/javapassion (Linkedin)
          http://twitter.com/javapassion (Tweeter)
            Life is worth living... with Passion!
Practically Free 3 to 5 days Live, Hands-on, Online Codecamps on
 Java, HTML5, Ruby/Rails, Grails, JavaScript/jQuery, Spring, Android
             http://jpassion.com/codecamps
----------------------------------------------------------------------

--
You received this message because you are subscribed to the Google Groups 
"JPassion.com: Java Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at http://groups.google.com/group/jpassion_java.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to