Section G.9. Module Declarations


G.9. 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.

G.9.1. 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; 



Java Enterprise in a Nutshell
Java Enterprise in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596101422
EAN: 2147483647
Year: 2004
Pages: 269

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net