Sockets

For basic communication, Java supports sockets. Sockets are used to establish communication between machines, sometimes used to establish communication between two processes on the same machine. Socket is just a channel through which applications can connect and communicate with each other. Sockets are generally of two types:

Connection-oriented
Connectionless.

A connection-oriented service is modeled after the telephone system, whereas a connection-less service is modeled after the postal system. Sockets are flexible and sufficient for general communication but they are not well suited to handle complex data types. Moreover, sockets are unsuitable for developing complex applications.

 

Remote Procedure Call (RPC)

An alternative to sockets is RPC. RPC enables an application to call procedures that exist on another machine. RPC makes a network connection to a remote machine using sockets. After the connection is made with the server, one can invoke a function on the remote machine. The programmer has the illusion of calling a local procedure, but actually the arguments are packaged and passed to the remote machine. RPC is easier to use than sockets. There are some drawbacks of using RPC, such as:

  • You can only pass simple data types & not objects as arguments.
  • The programmer must learn a special Interface Definition Language (IDL).

 

Common Object Request Broker Architecture(CORBA)

CORBA is a middleware technology developed by a consortium called OMG (Object Management Group). It is used mainly for applications in distributed architecture. Fundamental to the Common Object Request Broker Architecture is the Object Request Broker (ORB). An ORB is a software component used to establish communication between objects. The advantages of CORBA are:

  • It enables access to software running on different platforms.
  • It is language neutral.

 

Distributed Component Object Model (DCOM)

Microsoft(s) DCOM is an extension of the COM. COM is used to develop distributed applications on the same machine. DCOM places COM applications on the network. One of the limitations of using DCOM is that it can communicate only between applications developed in windows environment.

 

Remote method Invocation (RMI)

RMI is used to develop distributed applications. RMI has been specifically designed to operate in Java environment. Calling a remote method is almost the same as calling a local method. RMI uses a registry service for registering and locating objects. All marshaling of parameters and return values is taken care of by the system. An advantage of using RMI is that there is no need to learn another IDL language.

 

A lot of people get confusedTotally Confused between a computer network and a distributed system. Actually, the main difference between a distributed system and a network is: The user of a distributed system is not aware that there are multiple processors but with a network, users must explicitly log on to other machine, submit jobs, transfer files, etc.

A number of methods exist for developing network applications (e.g., sockets, RPC, RMI, CORBA, DCOM). All these methods have some advantages and disadvantages.

 

 

 

RMI BOOK MAIN PAGE                Top

  
Copyright © 2001 www.universalteacher.com