The CORBA Name Service is composed of two basic interfaces. The NameContext and the Binding Iterator. Remember that since the NameContext and the Binding Iterator are both CORBA interfaces, they are accessed via object references and are distributed. The NameContext contains named object references or other named NameContexts. It is similar to a directory that can contain named files or other named directories. NameContexts and Binding Iterators are usually implemented in the same Name Server process, but this is not a requirement. The CORBA NameService can be constructed as a set of interconnected NameContext objects and NameService processes.
The BindingIterator is used to iterate across object references contained within a particular NameContext. It basically provides a mechanism to get the number of named object references within a NameContext. It also provides a next_one and a next_n operation to retrieve individual named object references or contexts. Continuing with the directory analogy, The BindingIterator is a mechanism to do a ls or dir operation on a directory.
[ Top | Bottom | Previous section | Next section ]
The NameContext interfaces supports two main operations, bind and resolve. Once a NameContext object reference is obtained, it can be used to name some other CORBA object, or retrieve an object reference by name. This means that you can call the bind method on a NameContext passing it an object reference and a name. This will place a named object reference into the NameContext for future resolve calls. If an application wishes to obtain an object reference by name is simply obtains the appropriate NameContext and call resolve with the particular name. This will cause the named object reference to be returned to the application making the resolve invocation.
[ Top | Bottom | Previous section | Next section ]
The CORBA NameService was designed to allow object references to be obtained by name. Names need to be either agreed upon between servers or clients, or perhaps passed between components in the distributed application. It is also possible to use the BindingIterator interface to connect to any name object reference. The CORBA trading service might be more appropriate if the CORBA NameService is too limiting. Other architectures such as factories might be appropriate mechanisms to obtain object references.
[ Top | Bottom | Previous section | Next section ]