IPT Chapter 1
IPT Chapter 1
IPT Chapter 1
Chapter 1
In this chapter, you will learn three architectures of distributed object oriented
technologies or middleware technologies or Architectures for integrating systems such
as DCOM, CORBA, RMI and their comparisons.
Intersystem Communications:
The ability of two or more computer systems to share input, output, and storage
devices, and to send messages to each other by means of shared input and
output channels or by channels that directly connect central processors.
The term middleware is used to describe separate products that serve as the glue
between two applications. It is, therefore, distinct from import and export features
that may be built into one of the applications. Middleware is sometimes called
plumbing because it connects two sides of an application and passes data between
them.
1
Integrative programming and technologies
Modern program systems like Internet-based and enterprise applications offer multi-
tiered, component-based architectures that incorporate middleware for distributing
components across heterogeneous platforms. The platforms range from mobile
devices like personal digital assistants (PDA), laptops and mobile phones;
ubiquitous devices like televisions, refrigerators and cars; to different types of
computers like mainframes and PCs.
The basic idea behind network abstractions like RPC (Remote Procedure Call) is
to replace the local (server) and remote (client) end by stubs. This makes it
possible for both client and server to strictly use local calling conventions and
2
Integrative programming and technologies
The object services offered by all three approaches are defined through interfaces.
In all cases the interface is defined as a collection of named operations, each with
a defined signature and optionally a return type. The interface serves as a contract
between the server and client.
Remoting:
Many Distributed Object Technologies such as DCOM, CORBA model and Java
RMI are used to invoke a remote method, a code placed far from the calling
client, also known as remoting.
3
Integrative programming and technologies
(iii) At the server side, the wire protocol delivers the message to the server-
side stub.
(iv) The server-side stub then unpacks the message and calls the actual method
on the object.
In both CORBA and Java RMI, the server stub is called the skeleton and client
stub is called the stub or proxy . In DCOM, the client stub is called the proxy and
the server stub is called the stub.
CORBA
CORBA depends on an Object Request Broker (ORB), a central bus over which
CORBA objects interact transparently. CORBA uses Internet Inter-ORB Protocol (II-
ORB) for remoting objects.
To request a service, A CORBA client acquires an object reference to a CORBA
server object. The client then makes method calls on the object reference as if the
CORBA server object resided in the client’s address space. The ORB finds a
CORBA object’s implementation, prepares it to receive requests, communicates the
requests, and carries the replies back to the client. CORBA can be used on a
range of operating system platforms, from hand-held devices to mainframes.
DCOM
Java RMI
4
Integrative programming and technologies
RMI is the Java version generally known as a remote procedure call (RPC), with
the added ability to pass objects along with the request. The objects can include
information that change the service performed in the remote computer. This property
of RMI is often called “moving behavior.”
Java RMI relies on the Java Remote Method Protocol and on Java Object
Serialization, which allows objects to be transmitted as a stream of bytes. Since
Java Object Serialization is specific to Java, both the Java RMI server object and
the client object have to be written in Java. Java RMI allows client/server
applications to invoke methods across a distributed network of servers running the
Java Virtual Machine.
A Java RMI client acquires a reference to a Java RMI server object by looking up
a server object reference and invoking methods on the server object, as if the
Java RMI server object resided on the client. These server objects are named
using Universal Resource Locators (URL). A client acquires a reference by
specifying the server object’s URL, just as you would specify the URL to an
HTML page.
While CORBA, DCOM, and Java RMI all provide similar mechanisms for
transparently accessing remote distributed objects,
DCOM is a proprietary solution that works best in Microsoft environments.
For an organization that has adopted a Microsoft-centered strategy, DCOM is
an excellent choice. However, if any other operating systems are required in
the application architecture, DCOM is probably not the correct solution.
Because of its easy-to-use native-JAVA model, RMI is the simplest and
fastest way to implement distributed object architecture. It’s a good choice
for small applications implemented completely in Java. Since RMI’s native-
transport protocol, JRMP, can only communicate with other Java RMI
objects, it’s not a good choice for heterogeneous applications.
5
Integrative programming and technologies
CORBA and DCOM are similar in capability, but DCOM doesn’t yet support
operating system interoperability, which may discount it as a single solution.
At the moment, CORBA is the logical choice for building enterprise wide,
open-architecture, distributed object applications.
A client that wants to access a server object calls a COM runtime through COM
interfaces, which checks the client's permissions by invoking a security provider. If
the client has the appropriate permissions, the COM runtime invokes the
Distributed Computing Environment Remote Procedure Call (DCE RPC) that uses the
underlying protocol stack as one of communication methods. Before invoking a DCE
RPC, a client side COM runtime performs a marshalling through a proxy that
converts parameters into the form that could be transferred over the designated
protocol.
6
Integrative programming and technologies
The protocol stack on the server side receives the request, delivers it to the COM
runtime, which performs an unmarshalling through a stub that converts network
packets into parameters. The COM runtime activates the server object that calls the
object method and processes the request . A server object has the 3 types such as
an inproc, a local, and a service type. An inproc type takes the form of a Dynamic
Linking Library (DLL). An inproc type is the fastest type because it is loaded
directly into a client process when activated. A local type takes an executable
form. When activated, it is executed as a separate process. Lastly, a service
type is also similar to the local type in that both of them take executable forms,
but different from the local type in that the service type is always resident in a
memory, and receives a request from a client. In order to export the methods of
a server object, a server object should describe itself by using an Interface
Description Language (IDL).
For methods that are commonly used in the COM, COM previously creates a set
of common interfaces such as IUnknown, IDispatch, and IClassFactory. Although
Windows operating system incorporates it, both COM and DCOM are supported only
by limited operating systems, and they can't be used in most of web environments
due to protection policies.
Benefits of DCOM
Large User Base and Component Market
Binary Software Integration
o Large-scale software reuse (no source code)
o Cross-language software reuse
On-line software update
o Allows updating a component in an application without recompilation,
re-linking or even restarting
Multiple interfaces per object
Wide selection of programming tools available, most of which provide
automation of standard code
7
Integrative programming and technologies
Although CORBA is supported by various operating systems, its users should also
choose their own CORBA vendors because various vendors implementing CORBA
specification exist, and they can't be used in most of web environments due to
protection policies.
Benefits of CORBA
8
Integrative programming and technologies
RMI supports remote objects by running on a protocol called the Java Remote
Method Protocol (JRMP). Object serialization is heavily used to marshal and
unmarshal objects as streams. Both client and server have to be written in Java to
be able to use the object serialization. The Java server object defines interfaces
that can be used to access the object outside the current Java virtual machine
(JVM) from another JVM on for instance a different machine. A RMI registry on
the server machine holds information of the available server objects and provides a
naming service for RMI. A client acquires a server object reference through the
RMI registry on the server and invokes methods on the server object as if the
object resided in the client address space. The server objects are named using
URLs and the client acquires the server object reference by specifying the URL.
When a Java/RMI client requests a service from the Java/RMI server, it does the
following [Java/RMI]:
I. Initiates a connection with the remote JVM containing the remote object,
By using serialization of the objects, both data and code can be passed between
a server and a client – this allows different instances of an object to run on both
client and server machines. To insure that code is downloaded or uploaded safely,
RMI provides extra security.
To declare remote access to server objects in Java, every server object must
implement the java.rmi.Remote interface. java.rmi.server.RemoteObject and its
subclasses, java.rmi.server.RemoteServer, java.rmi.server.UnicastRemoteObject and
java.rmi.activation.Activatable provide RMI server functions. The class
java.rmi.server.RemoteObject provides implementations for the java.lang.Object
methods, hashCode, equals, and toString that are sensible for remote objects. The
classes UnicastRemoteObject and Activatable provide the methods needed to create
remote objects and make them available to remote clients. The subclasses identify
the semantics of the remote reference, for example whether the server is a simple
remote object or is an activatable remote object (one that executes when invoked)
[Java/RMI]. The java.rmi.server.UnicastRemoteObject class defines a singleton
(unicast) remote object whose references are valid only while the server process
is alive. The class java.rmi.activation.Activatable is an abstract class that defines an
activatable remote object that starts executing when its remote methods are invoked
and can shut itself down when necessary [Java/RMI]. Java/RMI can be used on
a diversity of platforms and operating systems as long as there is a JVM
implementation on the platform.
Benefits of RMI:
Support seamless remote invocation on objects in different virtual machines
Support callbacks from servers to applets
Integrate the distributed object model into the Java language in a natural
way while retaining most of the Java language's object semantics
Make differences between the distributed object model and local Java object
model apparent
Make writing reliable distributed applications as simple as possible
10
Integrative programming and technologies
Distributed
Network
Similarity3: All services provide some sort of registry or repository to
11