Module Declarations
A module is a name-scoping construct in IDL. It’s similar to
packages in Java or LISP or to namespaces in C++. A module is declared
with the module keyword, followed
by an identifier for the module and then the body of the module,
enclosed in braces:
// IDL
module identifier { ... };Modules can contain IDL interface definitions, constants, or
user-defined types, such as typedefs, structs, unions, and enumerations.
Mapping Modules to Java
Modules in IDL are mapped to packages in Java, and nested modules are mapped to subpackages, with the innermost module being mapped to the rightmost subpackage. If we have the following interfaces and modules defined in IDL:
// IDL
module util{
interface MatrixOps { ... };
module dbase {
interface Query { ... };
};
};the generated Java code includes an interface named MatrixOps, starting with this package statement:
// Java package util;
and another interface named Query, with this package statement:
// Java package util.dbase;
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access