Developing Java-based enterprise distributed application with RMI

Source: Internet
Author: User
Tags object serialization socket

Because Java has a wide and powerful function, such as Cross-platform, code portability, security, efficiency and so on, it can realize distributed computing with its own mechanism when developing network distributed application, a kind of Java based remote method call (RMI) For our development of enterprise distributed applications provide an effective solution.

Keywords Java RMI Enterprise Distributed Application

Overview

With the continuous deepening and development of information construction in electric power enterprises, the exchange of information and data between enterprises and enterprises has increased greatly, and the information and data need to be transmitted and exchanged between different computer networks more and more. At the same time, because of the existing computer network hardware and operating system of different units and departments, the application level is also uneven, so it is very important to develop a cross-platform, portable, efficient and secure network distributed application to serve the power enterprises.

In today's programming terminology, distributed computing has become a very common word, which distributes business data and programs in different physical locations of the network, and plays the function of remote data invocation by mobilizing the processing power of multiple computers on the network.

A remote method call (remote methods Invocation, RMI) that enables objects to communicate with objects between different Java virtual machines (JVMS). The JVM can reside on the same or different computers, and in multiple JVMs, a JVM can invoke methods that are stored in other JVM objects.

This paper mainly introduces the characteristics of RMI, analyzes the principle of applying RMI to the enterprise distributed computing, and the concrete steps of using RMI to realize the distributed application of enterprise based on Java.

Characteristics of remote Method invocation (RMI)

1, the disadvantage of TCP programming

Since the Java programming language was designed for object-oriented and support networks, the object-based RMI mechanism is already built into the Java platform.

We often use TCP/IP programming in Web development, which naturally involves socket (socket) programming. However, using socket programming requires a lot of repetitive coding, which is cumbersome and error-prone in complex distributed operations. Therefore, how to carry out network distributed computing quickly, efficiently, safely and scalable is the theme that developers always pursue and advocate. Until the advent of RMI, this complex, inefficient development situation has been greatly improved.

2, the characteristics of RMI programming

When we use object serialization to allocate objects on the network, RMI provides a unique and powerful distributed computing model unmatched by non-Java platforms, and RMI has the following features:

The client can invoke the method on the remote server as the local method;

Client/server Programming contracts can be specified according to the interface;

can automatically generate the transfer/reverse transfer code from the server object default binary class file;

Extends the Java programming model beyond the machine boundary (outside of the Java Virtual Machine (JVM) boundary) without any special syntax required;

You can also transfer behavior (code) with the data in a remote method call.

Although RMI is not the only enterprise-Class remote object access scenario, it is the easiest to implement.

3. RMI and CORBA

As a specification of the Distributed Application framework, Cobra was first and foremost developed by the Object Management Organization (OMG). Unlike CORBA, CORBA is able to implement distributed applications using different programming languages (such as C + +, basic, and so on), while RMI is a pure Java solution. In RMI, all parts of the program are written in the Java language, so that the programs developed are fully compliant with the Java specification, enabling cross-platform access, extension, and porting. According to the author of Northwest Electric Power Construction Group, the server operating system mainly has Linux and Windows2000 server, which exist in the company and the department, they are different system platform; At the same time, the company subordinate the project department is far away, nearly dozens of kilometers, As far as thousands of kilometers and even in foreign countries, so cross-platform and remote access these two functions in the development of enterprise application systems must be considered, and RMI just can use its own characteristics to meet programming needs.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.