O'Reilly logo

Java Enterprise in a Nutshell, Third Edition by William Crawford, Jim Farley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required