Today, ADT's have evolved into a collection of languages said to be object-oriented. Such languages express ADT's as objects. Thus, an Object is a basic computational unit consisting of a defined behavior and attributes. Requests made on an object are called methods. The visible portion of an Object is called its interface. Objects can be grouped and categorized into classes by their common attributes and behavior.
An implementation of the standard is known as an Object Request Broker (ORB) - a middleman to allow a client to make requests on objects. An ORB must be capable of making requests across a network, between operating systems, and between programming languages.
The interface to server objects is described in an implementation-neutral interface definition language (IDL) which provides separation of interface and implementation. IDL is not another new programming language, it only provides interface definitions to inform the clients about what exactly an object is offering. IDL compilers translate IDL modules into specific programming language modules. The IDL compiler generates stub code that the client links to, and skeleton code that is used by the server objects. An example written in IDL and the IDL to C++ mapping are given at the end of this appendix.
The architecture of an ORB is described in the figure below:
The basic functionality provided by the ORB consists of passing the requests from clients to the object implementations on which they are invoked. In order to make a request the client can communicate with the ORB Core through the IDL stub or through the Dynamic Invocation Interface (DII). The stub represents the mapping between the language of implementation of the client and the ORB core. Thus the client can be written in any language as long as the implementation of the ORB supports this mapping. The ORB Core then transfers the request to the object implementation which receives the request as an up-call through either an IDL skeleton, or a dynamic skeleton.
The communication between the object implementation and the ORB core is effected by the Object Adapter (OA). It handles services such as generation and interpretation of object references, method invocation, security of interactions, object and implementation activation and deactivation, mapping references corresponding to object implementations and registration of implementations. It is expected that there will be many different special-purpose object adapters to fulfill the needs of specific systems (for example databases).
// Point-of-sale object IDL example module POS { typedef string Barcode; interface InputMedia { /* define class */ typedef string OperatorCmd; void barcode_input(in Barcode item); void keypad_input(in OperatorCmd cmd); }; interface OutputMedia { boolean output(in string StringToPrint); }; interface POSTerminal { void end_of_sale(); void print_POS_sales_summary(); }; };CORBA IDL is a very close relative of C++. It supports basic and constructed types. Objects are declared as Interfaces (which resemble C++ classes). While not an exact mapping, the following list shows IDL types and their approximate C++ type.
IDL |
C++ |
boolean | bool |
char | signed char |
octet | 8 bits |
enum | enum |
short | short |
unsigned short | unsigned short |
long | long |
unsigned long | unsigned long |
float | float |
double | double |
any | (no native equivalent; similar to a void * accompanied by a type indicator) |
object | (closest to class) |
string | class string (bounded and unbounded lengths) |
struct | struct (like C, rather than a C++ struct) |
union | union (discriminated union; a type-tagged C struct) |
array | [ ] |
sequence | (a parameterized array of bounded or unbounded length) |