Middleware

Middleware is connectivity software that consists of a set of enabling services that allow multiple processes running on one or more machines to interact across a network. The most widely publicized middleware initiatives are the Open Software Foundation's Distributed Computing Environment (DCE), Object Management Group's Common Object Request Broker Architecture (CORBA), and Microsoft's COM/DCOM.

 

 

Figure1. Layers of middleware

As outlined in Figure 8, middleware services are sets of distributed software that exist between the application and the operating system and network services on a system node in the network. The main purpose of middleware services is to help solve many application connectivity and interoperability problems.

To fully understand middleware technology, we use Java technology as an example trying go through middleware technology step by step. First, we have TCP/IP Internet protocol stack:

Figure 2. The TCP/IP Protocol layers

The TCP/IP protocol stack: the IP protocol is responsible for transmitting IP datagrams, the basic unit of information, across a TCP/IP network. TCP uses IP to transport a reliable stream of information between two applications.

So, when set up a TCP connection, two machines can communicate each other, for example, using TCP sockets which is provided by Java technology to transfer data:

 

 

 

Figure 3. Host X machine communicating with web server using sockets

 

 

 

One of fundamental technologies of middleware is Remote Procedure Call (RPC).  Java technology provides a similar feature to RPC named Remote Method Invocation (RMI). As showed in Figure 12, RMI allows a thread to invoke a method on a remote object. Objects are considered remote if they are residing in a different JVM.

 

 

 

Figure 4. Java Remote Method Invocation (RMI)

 

To make remote methods transparent to both the client and the server, RMI implements the remote object using stubs and skeletons.

 

 

Figure 5. RMI parameters marshaling

 

A stub is a proxy for the remote object; it resides with the client. When a client invokes a remote method, it is this stub for the remote object that is called. This client-side stub is responsible for creating a parcel consisting of the name of the method to be invoked on the server and that method’s parameters, a process known as marshalling the parameters. The stub then sends this parcel to the server, where it is received by the skeleton then marshals the return value (or exception, if any) into a parcel and returns this parcel to the client. This stub unmarshals the return value and passes it to the client.

RMI is a technology that allows threads to invoke methods on distributed objects, but it required all distributed applications to be written in Java. The Common Object Request Broker Architecture (CORBA) is middleware that allows heterogeneous client and server applications to communicate.

Both RMI and CORBA are distributed object systems: Objects are distributed across a network and application can communicate with the distributed objects. An important feature of such system is an object-registration service, with which an object registers itself. Applications that wish to use a distributed object obtain a reference to the object through this service; for example, Java rmiregistery acts as the registration for RMI. 

A simplified JavaTM IDL (Interface Description Language) Hello Client-Server example would illuminate the middleware technology:

 

Figure 6 Communication between the client and server

 

The process of communication between the client and server is following: [from: java.sun.com]

1).The client (applet or application) invokes the sayHello operation of the HelloServer;

2).The ORB transfers that invocation to the servant object registered for that IDL interface;

3).The servant’s sayHello method runs, returning a Java String;

4). The ORB transfers that String back to the client;

5).The client prints the value of the String.

 

1.Open source resources

ACE+TAO project:

http://www.cs.wustl.edu/~schmidt/TAO.html

2.Web pages

CORBA is a popular middleware technique, the following link contain useful information about that:

http://www.cs.wustl.edu/~schmidt/corba.html

 

3.Citations

COMMiddleware - focuses on Microsoft's enterprise middleware technologies: COM+, DCOM, MTS, MSMQ, etc. Published by Hegetor Ltd., the www.middleware.net  sponsor, every month, it's advert-free