Q: using nested namespace in IDL

Q: using nested namespace in IDL

Post by zhou » Thu, 03 Jul 2003 22:47:15



Hi there,

We are exposing the functionalities of a large system as CORBA services. As we build IDL, the question comes up:

should we use more than one namespace in our IDL, i.e., having nested "Module"?

Currently everything is under one Module. I am wondering the pros and cons of having sub-namespaces so that each
functionality group belongs to one sub-namespace. (We are using C++ to implement CORBA services)

Since the IDL modules get mapped to C++ namespace, which is not intuitive if you have a few in your system. I hesistate
to use more than one namespace. In fact, I donot see the advantage of nested namespaces in IDL other than avoiding name
collision (which we can avoid with a little caution).

Any suggestions?
Thanks.

Yan

 
 
 

Q: using nested namespace in IDL

Post by Brian Kel » Fri, 04 Jul 2003 05:32:49


Quote:> should we use more than one namespace in our IDL, i.e., having
> nested "Module"?

> Currently everything is under one Module. I am wondering the pros
> and cons of having sub-namespaces so that each
> functionality group belongs to one sub-namespace. (We are using C++ to
> implement CORBA services)

> Since the IDL modules get mapped to C++ namespace, which is not intuitive
> if you have a few in your system. I hesistate to use more than one
> namespace. In fact, I donot see the advantage of nested namespaces in
> IDL other than avoiding name collision (which we can avoid with a
> little caution).

You can certainly have module/namespace overkill, and
ending up with say, 6 levels of nesting for no good reason
will lead to lots of "using" statements in your C++ code,
and that doesn't help either.

However, I think that using one level of nesting is fine,
and it certainly shouldn't impact your system or make it
unintuitive to code that way. You'll need to make the
decision based on the contents of your IDL.

Just as long as definitions aren't at global scope, most
people won't complain ;-)

Cheers,
Brian
IONA Technologies

 
 
 

1. Namespace nesting


official "std" namespace of C++ standard definitely is the "::std"
namespace, and that a nested "std" namespace (e.g. "::foo::std") is C++
compliant.

So, how does the CORBA C++ binding resolve this problem? Or, more
specifically, is

  namespace foo
  {
      namespace CORBA
      {
         struct Exception {};
      }

      CORBA::Exception anException;
   }

compliant to the C++ binding?

/Sverker Wiberg

 [1]
http://groups.google.com/groups?selm=3D51871F.84FD465D%40iobox.com&ou...

2. fuzzy logic and genetic algorithms

3. Nested namespace extensions

4. New FDHDs - reliable?

5. mapping idl modules to classes without namespaces

6. necking down traces with CCT

7. namespace from idl

8. InterScan machine placement

9. HELP: "Namespace" Problem with IDL/C++ typedefs

10. HELP !!! IDL-namespaces / multiple packages

11. Nested sequences allowed in IDL

12. Orbix 2.3c idl compiler and nested modules

13. IDL-struct with nested types