RMI Remote Method Call Tutorial
1. RMI Overview
RMI (Remote method invocation)
RMI is a distributed object package that simplifies communication between Java applications on multiple machines.
Must be above the jdk1.1
Classes used by RMI
Java.rmi.Remote
All objects that can be invoked remotely must implement this interface
Java.rmi.server.UnicastRemoteObject
All objects that can be invoked remotely must extend the class
What is RMI
A remote method call is a mechanism by which objects between computers invoke each other's functions to start each other's processes, using this mechanism when an object on a computer invokes a method on another computer.
The order grammar rules are the same as the syntax rules for method calls between objects on the local machine.
Advantages
This mechanism has brought great convenience to the system design and programming of distributed computing.
As long as you follow the RMI rules to design the program, you can no longer have to ask about the network details under RMI, such as: TCP and socket and so on.
The communication between any two computers is entirely the responsibility of RMI. Calling objects on a remote computer is as convenient as a local object.
1. Object oriented:
RMI can pass complete objects as parameters and return values, not just predefined data types.
That is, a complex type like the Java Hassi can be passed as a parameter.
2, removable properties:
RMI can move properties from the client to the server or from the server to the client.
3. Design Method:
Object passing enables you to take advantage of the powerful features of object-oriented technology in distributed computing, such as two-tier and three-tier architecture systems.
If users can pass properties, they can use an object-oriented design approach in their own solutions.
All object-oriented design methods rely on different attributes to function, if complete objects are not delivered-including implementations and types
-You lose the benefits of the design approach.