Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Advanced CORBA Programming wit C++ - M. Henning, S. Vinoski.pdf
Скачиваний:
65
Добавлен:
24.05.2014
Размер:
5 Mб
Скачать

IT-SC book: Advanced CORBA® Programming with C++

Keep in mind that escaped identifiers were added only to permit addition of new keywords. There is no point or purpose in using a leading underscore for IDL identifiers otherwise, even though it is legal:

interface _Thermometer { // Legal in CORBA 2.3, but useless // ...

};

In CORBA 2.3 and later, this definition behaves exactly as if we had used Thermometer as the interface name.

4.22 Summary

OMG IDL is CORBA's language-independent mechanism for defining data types and object interfaces. IDL decouples client implementations from server implementations and establishes the contract that clients and servers adhere to. IDL specifications are translated by a compiler into language-specific stubs and skeletons. The stubs and skeletons provide client-side and server-side APIs to support implementations in a particular language.

IDL provides a set of built-in types that can easily be translated into most programming languages. The set of built-in types can be augmented by user-defined types, such as structures and sequences. IDL provides object orientation through interface inheritance, which in turn establishes type compatibility and polymorphism. Exceptions serve as a uniform error-handling mechanism, and modules provide a grouping construct to prevent namespace pollution. Repository IDs provide unique internal names for IDL types; #pragma directives permit you to change default repository IDs transparently to the application code and prevent accidental clashes with other developers.

With CORBA 2.2, IDL was extended to support wide characters and strings, 64-bit integers, type long double, and fixed-point types. Escaped identifiers, added with CORBA 2.3, permit new keywords to be added to IDL without breaking existing implementation code.

121