ITSE205-DataStructures and Algorithms
ITSE205-DataStructures and Algorithms
Model (DCOM), OMG's Common Object Request Broker Architecture (CORBA), and Sun’s
Java/Remote Method Invocation (Java/RMI). In this article, you learn about the CORBA architecture and the
mechanics of developing CORBA clients and servers.
CORBA defines a model that specifies interoperability between distributed objects on a network in a way that is
transparent to the programmer.
CORBA automatically handles a lot of network programming tasks, such as object registration, object location,
object activation, request demultiplexing, frame and error-handling, marshaling, and operation dispatching.
CORBA objects are accessed through the use of an interface. OMG's Interface Definition Language (IDL, for
short) is used to define interfaces, their attributes, methods, and parameters to those methods within the
interface.
CORBA relies on a protocol called the Internet Inter-ORB Protocol (IIOP) for remoting objects. Everything
in the CORBA architecture depends on an Object Request Broker (ORB).
Some of the benefits of CORBA include, but are not limited to, the following:
3. CORBA is scalable.
Compiled by T V Sathyanarayana
The Core Object Model defines concepts that facilitate distributed application development using the Object
Request Broker (ORB). It defines a framework for refining the CORBA model to a concrete form. The Core
Object Model is an abstract specification that does not attempt to detail the syntax of object interfaces or any
other part of the ORB This model provides the basis for CORBA, but is more relevant to ORB designers and
implementers than it is to application developers.
The Reference Model defines a development model for CORBA and its standard interfaces through which
developers can create and use frameworks, components, and objects. This model places the ORB at the center
of a grouping of objects with standardized interfaces that provide support for application developers. In addition
to the ORB, the Reference model identifies four groupings:
Compiled by T V Sathyanarayana
Figure 2 shows the CORBA 2.0 architecture. In CORBA, the IDL compiler generates type information for each
method in an interface and stores it in the Interface Repository (IR). A client can thus query the IR to get run-
time information about a particular interface and then use that information to create and invoke a method on the
remote CORBA Server Object dynamically through the Dynamic Invocation Interface (DII). Similarly, on the
server side, the Dynamic Skeleton Interface (DSI) enables a client to invoke an operation of a remote CORBA
Server Object that has no compile time knowledge of the type of object it is implementing.
One CORBA object never talks directly with another. Instead, the object requests for an interface to the ORB
running on the local machine. The local ORB then passes the request to an ORB on the other machine. The
remote ORB then locates the appropriate object and passes back an object reference to the requester.
Compiled by T V Sathyanarayana
• Invoke methods on a remote object using static method invocation
• Invoke methods on a remote object using dynamic method invocation
• Automatically instantiate objects not currently running
• Route callback methods to the appropriate local object being managed
• Communicate with other ORBs using the Internet Inter-ORB Protocol (IIOP)
Object Adapters
An Object Adapter is a server-side facility that provides a mechanism for the CORBA object implementations
to communicate with the ORB and vice versa. An Object Adapter also extends the functionality of the ORB. An
Object Adapter is layered on top of the ORB Core to provide an interface between the ORB and the object
implementation. Object Adapters can also be used to provide specialized services optimized for a particular
environment, platform, or object implementation.
While many object adapter implementations may exist for unique situations, the CORBA specification only
requires implementations to provide a Basic Object Adapter (BOA) or a Portable Object Adapter (POA) which
is a portable version of the BOA.
A BOA may be required to perform two types of activations on behalf of a client’s request: implementation
activation and object activation.
Implementation Activation: This occurs when the implementation for the target object is unavailable to handle
the request. This requires the use of a daemon that can launch a Java VM with the server’s byte code. The
information necessary to associate an object implementation with a Java class is stored in the Implementation
Repository.
Object Activation: This occurs when the target object is unavailable to handle the request.
Compiled by T V Sathyanarayana
The BOA is mandated by CORBA 2.0, but was recently deprecated in favor of a Portable Object Adapter
(POA). Even though vendors, to support existing implementations, may support the BOA, OMG will no longer
update the BOA specifications.
Interface Repository
The Interface Repository (IR) is an online database of metainformation about ORB object types.
Metainformation stored for objects includes information about modules, interfaces, operations, attributes and
exceptions.
Compiled by T V Sathyanarayana
The Interface Definition Language (IDL)
Whenever a client needs some service from a remote distributed object, it invokes a method implemented by the
remote object. The service the remote distributed object (server) provides is encapsulated as an object and the
remote object's interface is described in an Interface Definition Language (IDL). The interfaces specified in the
IDL file serve as a contract between a remote object server and its clients. Clients can thus interact with these
remote object servers by invoking methods defined in the IDL. CORBA supports multiple inheritance at the
IDL level and allows exceptions to be specified in the IDL definitions.
module SimpleStocks {
interface StockMarket {
float get_price( in string symbol );
};
};
Generated classes
In addition to the Java class that maps directly from an IDL construct, helper and holder classes may be
generated to aid the developer in the use of the class.
Holder classes
The holder classes provide a level of indirection and are passed instead of the actual type. The client
instantiates a holder object and passes it in the operation invocation. The server may then set or modify the
value member of the holder object. Because the encapsulated actual object is modified without affecting the
holder object reference itself, the semantics of out and inout parameters are supported. Holder classes are
available for all the basic IDL datatypes in the org.omg.CORBA package and are generated for all named user-
defined types, except those defined by nonconstructed type typedefs.
Compiled by T V Sathyanarayana
Helper classes
A helper class contains convenience and utility methods for operating on the associated object. The purpose of
the helper class is to prevent bloating of the mapped classes with methods that may not be needed. The class
provides methods for reading and writing the object to a stream, obtaining the object’s repopsitory identifier,
and casting the object to/from a CORBA Any. The helper classes for mapped IDL interfaces also have the
narrow() method defined, which is used to cast the object reference of org.omg.CORBA.Object to the
base type of the helper.
Compiled by T V Sathyanarayana
Java IDL Development Lifecycle
2. Use the IDL compiler to generate the client stub code and server skeleton code.
Before developing CORBA servers and clients, make sure you have Java 1.2 and the idltojava compiler
installed on your machine. The JDK provides the API and ORB needed to enable CORBA-based distributed
object interaction. The idltojava compiler uses the IDL-to-Java mapping to convert IDL interface definitions to
corresponding Java interfaces, classes, and methods, which you can then use to implement your client and
server code.
Compiled by T V Sathyanarayana