A Real World Problem



WHAT IS CORBA? - the Common ORB architecture

Distributed objects are the next wave in Internet innovation. CORBA, the Common Object Request Broker Architecture defined by the Object Management Group (OMG), specifies how software objects distributed over a network can work together without regard to client and server operating systems and programming languages.

CORBA is a complete distributed object platform. It extends applications across networks, languages, component boundaries, and operating systems. A CORBA Object Request Broker (ORB) connects a client application with the objects it wishes to use. The client application does not need to know whether the object resides on the same computer or on a remote computer elsewhere on the network. The client application needs to know only two pieces of information: the object's name and how to use the object's interface. The ORB takes care of the details of locating the object, routing the request, and returning the result


CORBA fits the component-based and Internet-based approaches to building and using software. It defines a way to divide application logic among objects distributed over a network, some on clients, others on a variety of servers. It also defines a way for those objects to communicate and use each others' services. CORBA supplements Java with a rich set of services that includes introspection, dynamic discovery, transactions, security, naming, and more. CORBA links the Java mobile code environment and the world of interoperable objects.



CORBA ORB Architecture

The following figure illustrates the primary components in the CORBA ORB architecture. Descriptions of these components are available below the figure.

CORBA ORB Architecture


OMG Reference Model Architecture


CREATING CORBA OBJECTS

You can create CORBA objects in one of two general ways:

USING IDL

CORBA defines an interface definition language (IDL) that provides a language-neutral way to describe a CORBA object and the services it provides. IDL lets components written in different languages communicate with each other using IIOP and the rest of the CORBA architecture. CORBA objects can reside on different types of systems, including Windows or UNIX servers and IBM 3090 or DEC VAX mainframes. They can be written in different languages. As long as interfaces to their services are written in IDL, the objects can communicate and use each others' services through ORBs on clients, servers, database systems, mainframes, and other systems on the network.

Developing Applications

To develop distributed applications with IDL, you must first identify the objects required by the application. You will then usually follow these steps:

  1. Write a specification for each object using the Interface Definition Language (IDL).
  2. Use idl2java to generate the client stub code and service skeleton code.
  3. Implement the service interface.
  4. Write an application (often called a server application or object server) to create, activate, and register an instance of the service.
  5. Write the client application (or applet) code.
  6.  Use javac to compile the service interface, server application, and client application (or applet).
  7.  Start the server application.
  8. Run the client application (or applet). When the client invokes a service method, the call goes through the client-side stubs to the ORB, which uses the server-side skeletons and information from the server application to locate the service implementation and call the method.


Caffeine: CORBA WITHOUT IDL

Netscape's Enterprise Server 3.0 includes a java2iiop compiler (also called Caffeine) for defining CORBA-compliant interfaces using Java instead of IDL. By using java2iiop, you can generate the necessary container classes, client stubs, and server skeletons from Java bytecode. Caffeine makes it easy for Java programmers to write objects that interoperate across Java VMs using Java language semantics. You don't have to learn CORBA IDL to make Java objects remotable and accessible via a CORBA IIOP ORB. Caffeine also lets you pass objects by value. Finally, it provides a naming service that maps CORBA object references to URLs. The following figure shows the development process.

Other Examples

Hello World with Java IDL

"Ping" Client with Vbroker

ORBs Tested for this Class


COMPETITION

This section presents competing technologies, that is, technologies developed to do what CORBA does.

HTTP and CGI The CGI/HTTP protocol is clumsy, stateless, and extremely slow-much slower than CORBA IIOP. Programming Internet client-server applications with CGI is a very poor choice. The bad news is that CGI is the premier three-tier client-server application model for the Internet today. The good news is that the leading Internet architects, well aware of CGI's shortcomings, are migrating to alternative technologies. Netscape will do its part by bundling a CORBA ORB with every browser. 

RMI First, RMI does not provide language-neutral messaging services. In other words, RMI objects can talk only to other RMI objects. With RMI, you cannot invoke objects written in other languages or vice versa. Second, RMI does not support dynamic invocations and interface repositories. Third, RMI does not provide a wire protocol for security and transactions. RMI is both proprietary and lightweight. It was not designed to interoperate with other ORBs or languages. Unlike CORBA's IIOP, RMI is not a suitable backbone for the Internet or intranets; it lacks services IIOP provides. 

DCOM A DCOM object is not an object in the object-oriented programming sense; a DCOM object does not have a persistent object reference that lets you reconnect to the same object at a later time. In other words, DCOM objects do not maintain state between connections. This can be a big problem in environments where you have faulty connections - for example, the Internet. The current implementation of DCOM does not support distributed naming services; it is based on the NT registry. Configuring DCOM and installing type libraries is tedious and labor-intensive. DCOM is also Windows-centric. Very few implementations of DCOM run on non-Windows platforms. Finally, for DCOM to scale on the server side, it requires the Microsoft Transaction Server (MTS). Microsoft has no immediate plans to port MTS to non-NT platforms. 

RPC With an RPC, you call a specific function (the data is separate). In contrast, with an ORB, you call a method within a specific object. Different object classes may respond to the same method call differently. Because each object manages its own private instance data, the method is implemented on that specific instance data. ORB method invocations are precise. The call gets to a specific object that controls specific data and then implements the function in its own class-specific way. In contrast, RPC classes have no specificity: all the functions with the same name are implemented the same way. 


What about RMI?

Though RMI is an ORB in the generic sense that it supports making method invocations on remote objects, it's not a CORBA-compliant ORB. RMI is native to Java. It is, in essence, an extension to the core language. RMI depends on many of the other features of Java-object serialization, portable, down-loadable object implementations, and Java interface definitions, among others. The resulting mechanism is very natural for Java programmers to use. They never have to leave the Java programming environment or learn any new "foreign" technology. On the other hand, RMI has some limitations, principle among which is a consequence of its greatest strength-its tight integration with Java makes it impractical for use with objects or applications written in any other language.

Java, RMI and CORBA

A white paper prepared by David Curtis, Director of Platform Technology Object Management Group