Interfaces: The Heart of RMI
by, 07-07-2012 at 06:23 PM (841 Views)
One principle is associated with RMI architecture and that is the implementation of behavior and definition of behavior are totally separate concepts. Code is allowed by RMI which defines what behavior is and also the code which keeps it separate.
This is nicely fitted with the distributed system needs where clients have major concern regarding the service definition and servers to be focused to provide the services.
Remote service definition in RMI is coded by usage of a Java interface. In a class, the remote service implementation is being coded. Hence, RMI could be understood by remembering that classes would be defining the implementation and interfaces would define the behavior.
Separation is illustrated in this given diagram:
Remote service definition 1
It shall be remembered that an executable code is not present in java interface. Two classes are supported by RMI which would be implementing the similar interface. First class is the behaviorís implementation that would run at server. Second one acts to be proxy and runs at client. This is shown as following:
Remote service definition 2