Naming Scopes

Each IDL file that you create defines a namespace or naming scope for identifiers that you declare within that file. This namespace is further subdivided into nested scopes whenever you declare a new module, interface, structure, union, or exception in your IDL file. You can think of the naming scope within an IDL file as a sort of naming directory. By default, you start at the root of the directory, and each time you open a declaration of one of these items, you start a new subdirectory of the naming directory, named after the identifier you use for the item.

You can specify scopes using the :: delimiter, which is analogous to the . delimiters in Java class names or the / or \ delimiters in file directories. The root scope for the IDL file is represented as :: by itself, and nested scopes are specified by adding their names, such as ::utils::math::MatrixOps. The names in a scope name can refer to any identifiers that might exist in each scope. In this example case, utils and math might refer to modules (the math module is declared within the utils module), and MatrixOps might refer to an interface declared within the math module. The intermediate elements of a scoped name must refer to one of the IDL elements that define their own scopes (listed previously), but the final element of a scoped name can refer to any item with its own identifier, including constants, data members on interfaces, and so forth.

Within any particular scope in the naming scope of an IDL file ...

Get Java Enterprise in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.