+2 votes
Where we can apply this

Please help me to understand this with some eg....
asked Feb 11, 2016 in Computer Science - IT by Dharani | 1,222 views

1 Answer

+1 vote
Selected Ans.

Your question is obvious and i appreciate for asking such a question,because if we relate questions to real world applications ,concepts will be more clearer.

RMI is Remote Method Invocation,hope you know that ,but what is RMI ?

Let me answer this with an example from oracle docs for java :

Consider you are running a bank , and it will have some policies on which financial dealings are done ,right ?

Also consider you have an application to process the financial statements like expenses .

Now one day you have changed policies for the bank ,hence we need to update the software in all client systems to follow new rules in calculations.

What are all options available for you ?

  • Install the policy with the client systems.- this would not be applicable if some one dont update the new software
  • You could have the policy checked by the server when each entry is added to the expense report. -this will increase server traffic and may cause server slow down
  • You could have the policy checked by the server when the report is submitted.-this will create bad entries by users.

So what is the solution ?

Yes ,we have RMI for rescue , but how ?

  • With RMI you can have the client upload behavior from the server with a simple method invocation, providing a flexible way to offload computation from the server to the clients while providing users with faster feedback. 
  • When a user is ready to write up a new expense report, the client asks the server for an object that embodies the current policies for expense reports as expressed via a Policy interface written in Java. 
  • The object can implement the policy in any way. If this is the first time that the client's RMI runtime has seen this particular implementation of the policy, 
  • RMI will ask the server for a copy of the implementation. Should the implementation change tomorrow, a new kind of policy object will be returned to the client, and the RMI runtime will then ask for that new implementation.

This means that policy is always dynamic.

This is a better approach than any static approach because:

  • All clients don't need to be halted and updated with new software-software is updated on the fly as needed.
  • The server is not burdened with entry checking that can be done locally.
  • Allows dynamic constraints because object implementations, not just data, are passed between client and server.
  • Lets users know immediately about errors.

Read more here : http://www.oracle.com/technetwork/java/javase/tech/index-jsp-138781.html


RPC with "object" orientation is called RMI

Remote Procedure Call (RPC) is a protocol that one program can use to request a service from a program located in another computer in a network without having to understand network details.

Note : RMI is implemented in applications 

answered Feb 11, 2016 by ppk
selected Feb 12, 2016 by Dharani
good answer +1