SDSU CS 696 Emerging Technologies: Distributed Objects
Spring Semester, 1998

To Lecture Notes Index
© 1998, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 21-Apr-98

Contents of Doc 19, CORBA Intro

  1. References
  2. Introduction
    1. CORBA Architecture
    2. The Broker Pattern
      1. Dynamics
      2. Variants
      3. Known Uses
      4. Consequences
    3. A Simple CORBA Example using OrbixWeb


Pattern-Oriented Software: A System of Patterns, Buschman, Meunier, Rohnert, Sommerlad, Stal, 1996, pp 99-122 (Broker pattern)

OMG web site:

OrbixWeb Programmer's Guide, IONA Technologies PLC, November 1997, chapter 2 Getting Started with Java Applications, pp 33 - 54

Inside CORBA: Distributed Object Standards and Applications, Mowbray & Ruh, Addison-Wesley, 1997

Doc 19, CORBA Intro Slide # 2


CORBA - Common Object Request Broker Architecture

Object Management Group
Develops CORBA standards, but does not implement
See: for more information on OMG and CORBA

Some ORB Venders

Iona - Orbix, OrbixWeb
Visigenic - Visibroker
Sun - Java IDL in JDK 1.2
Object Oriented Concepts - OmniBroker
Object Space - Voyager

A list of ORB, free and otherwise can be found at:

Doc 19, CORBA Intro Slide # 3
Some History
OMG Formed1989
CORBA 11991
CORBA 1.2June, 1994
Smalltalk Language Mapping March 28, 1995
Time Service March 19, 1996
C++ Language Mapping 1.1 March 19, 1996
Ada Language Mapping March 19, 1996
CORBA 2.0 July 1, 1996
Object Trader Service October 30, 1996
CORBA Interoperability October 30, 1996
IDL COBOL Mapping March 11, 1997
Transaction Service 1.1 June 24, 1997
IDL Java Mapping 1.0 June 24, 1997
CORBA 2.1 September 23, 1997
COM/CORBA Part B November 19, 1997
COM/CORBA Part A Revision November 19, 1997
Mobile Agents Facility February 10, 1998
CORBA 2.2 March 2, 1998

Doc 19, CORBA Intro Slide # 4

CORBA Architecture

Object Request Broker
Provides an infrastructure allowing objects to interact, independent of the specific platforms and languages used to implement the objects.

Object Services
Standardize the life-cycle management of objects
Services cover such items as
Creating objects
Controlling access to objects
Keeping track of relocated objects,
Controlling the relationship between styles of objects
Object Services provide for application consistency

Doc 19, CORBA Intro Slide # 5

Common Facilities
Commercially known as CORBAfacilities
A set of generic application functions such as
document management
electronic mail facilities
Include facilities for use over the Internet

Domain Interfaces
Vertical areas that provide functionality of direct interest to end-users in particular application domains

Doc 19, CORBA Intro Slide # 6

The Broker Pattern

Doc 19, CORBA Intro Slide # 7

A broker
Handles the transmission of requests from clients to servers
Handles the transmission of responses from servers to clients
Must have some means to identify and locate server
If server is hosted by different broker, forwards the request to other broker
If server is inactive, active the server
Provides APIs for registering servers and invoking server methods

Optional components used for hiding implementation details when two brokers interoperate

Doc 19, CORBA Intro Slide # 8


Registering Server

Doc 19, CORBA Intro Slide # 9
Client Server Interaction

Doc 19, CORBA Intro Slide # 10


Direct Communication Broker System
Broker gives the client a communication channel to the server
Client and server interact directly
Many CORBA implementation use this variant

Message Passing Broker System
Clients and servers pass messages rather than services (methods)

Trader System
Clients request a service, not a server
Broker forwards the request to a server that provides the service

Adapter Broker System
Hide the interface of the broker component to the servers using an additional layer
The adapter layer is responsible for registering servers and interacting with servers
For example if all server objects are on the same machine as application a special adapter could link the objects to the application directly

Doc 19, CORBA Intro Slide # 11

Callback Broker System
Eliminate the difference between clients and servers
When an event is registered with a broker, it calls the component that is registered to handle the event

Doc 19, CORBA Intro Slide # 12

Known Uses



Mircosoft OLE 2.x




Location Transparency
Clients (servers) do not care where servers (clients)are located

Changeability and extensibility of components
Changes to server implementations are transparent to clients if they don't change interfaces
Changes to internal broker implementation does not affect clients and servers
One can change communication mechanisms without changing client and server code

Portability of Broker System
Porting client & servers to a new system usually just requires recompiling the code

Doc 19, CORBA Intro Slide # 13
Benefits - Continued

Interoperability between different Broker System
Different broker systems may interoperate if they have a common protocol for the exchange of messages
CORBA defines a general inter-ORB protocol (GIOP) for orb to orb communication
Internet inter--ORB protocol (IIOP) is the TCP/IP version of GIOP
DCOM and CORBA interoperate
DCOM and RMI interoperate
Soon RMI and CORBA will interoperate

In building new clients you can reuse existing services

Doc 19, CORBA Intro Slide # 14

Restricted Efficiency

Lower fault tolerance compared to non-distributed software

Benefits and Liabilities

Testing and Debugging
A client application using tested services is easier to test than creating the software from scratch
Debugging a Broker system can be difficult

What is an Object Request Broker (ORB)?
Doc 19, CORBA Intro Slide # 15

A Simple CORBA Example using OrbixWeb

Step 1 Create an interface for the server using the CORBA interface definition language (IDL)

Place the following code in the file Hello.idl
interface Hello
   string sayHello();

Step 2 Compile the IDL interface
idl Hello.idl

This creates a directory called java_output which contains:

Doc 19, CORBA Intro Slide # 16
IDL output
Client interface to server

Client side proxy for server

Server side proxy

Abstract class to use as parent class to server
This is called the ImplBase approach

Java class which allows server to use composition (delegation) rather than having to inherit from _HelloImplBase
This is called the TIE approach

Used in the TIE approach
Java interface that maps the attributes and operations of the IDL definition to Java methods

A Java package used to contain any IDL types nested in the Hello interface

A Java class that allows IDL user-defined types to be manipulated in various ways

Used for passing Hello objects as parameters

Doc 19, CORBA Intro Slide # 17

Step 3 Implementing the Server using Inheritance
Classes generated by OrbixWeb IDL compiler Hello
public interface Hello
    extends org.omg.CORBA.Object
    public String sayHello() ;
    public java.lang.Object _deref() ;

import IE.Iona.OrbixWeb._OrbixWeb;

public abstract class _HelloImplBase 
    extends _HelloSkeleton 
    implements Hello 
    public _HelloImplBase() {

    public _HelloImplBase(String marker) {

    public _HelloImplBase(IE.Iona.OrbixWeb.Features.LoaderClass loader) {

    public _HelloImplBase(String marker,
                        IE.Iona.OrbixWeb.Features.LoaderClass loader) {

    public java.lang.Object _deref() {
        return this;


Doc 19, CORBA Intro Slide # 18
Programmer Implemented ClassesHelloImplementation
public class HelloImplementation extends _HelloImplBase
   public String sayHello()
      return "Hello World";
import IE.Iona.OrbixWeb._CORBA;
import IE.Iona.OrbixWeb.CORBA.ORB;

public class HelloServer
   public static void main (String args[])
      org.omg.CORBA.ORB ord =
         Hello server = new HelloImplementation();
         _CORBA.Orbix.impl_is_ready( "HelloServer" );
         System.out.println("Server going Down");
      catch ( org.omg.CORBA.SystemException corbaError)
         System.out.println("Exception " + corbaError);

Doc 19, CORBA Intro Slide # 19
Step 4 Compiling the Server

The classpath must include the following:
Java JDK classes
org.omg.CORBA package
IR.Iona.OrbixWeb package

Must compile the following classes:

Doc 19, CORBA Intro Slide # 20

Step 5 Registering and running the Server

Make sure that the OrbixWeb daemon (orbixdj) is running on the server machine

You start the deamon by the command:
orbixdj -textConsole

Now register the server via:
putit HelloServer -java HelloServer

Now run the server via
java HelloServer

Note running the server is not normally required, however, since the server is not in a package it is hard to get the ORB to activate the server. We will address this issue later

Details of the above process will be discussed later

Doc 19, CORBA Intro Slide # 21

Step 6 Writing the client
import IE.Iona.OrbixWeb._CORBA;
import org.omg.CORBA.ORB;

public class HelloClient
   public static void main(String args[])
      String hostname = "";
      String serverLabel = ":HelloServer";
      Hello server = HelloHelper.bind( serverLabel, hostname);
      System.out.println( server.sayHello() );

Doc 19, CORBA Intro Slide # 22

Step 7 Compiling and Running the client

Compile the classes:

Now run the client with the command:

java HelloClient
Output - Client Window
[New IIOP Connection (,IT_daemon, null,null,pid=0) ]
[New IIOP Connection (,HelloServer, null,null,pid=0) ]
Hello World

Output - Server Window
[ HelloServer: New Connection ( ]
[ HelloServer: End of IIOP connection ( ]

Output - Daemon Window
[ IT_daemon: New Connection ( ]
[ IT_daemon: End of IIOP connection ( ]

visitors since 17-Mar-98