"J. J. Merelo" wrote:
>
> Murray Cumming wrote:
> >
> > "J. J. Merelo" wrote:
> > >
> > > -1
> > >
> > > > 1. It helps addressing the name collisions between header files from various
>libraries that, unfortunately(but realistically), have the same names. Different
>products (3rd party or user applications) can
> > > > also have e.g. <util/Base64.hpp> or <util/Mutexes.hpp>. So, why not have the
>Xerces include paths start with <xercesc/...> which makes things more obvious and can
>help avoid some problems.
> > >
> > > Those can be addressed individually, on a file-by-file basis.
> >
> > Please elaborate on this last sentence.
> >
>
> Sure! if you have a src/veryCommonName.hpp and you need to include
> another veryCommonName.hpp from another source, you just change
> veryCommonName.hpp in xerces to notSoCommonName.hpp, or to
> xerces_veryCommonName.hpp.
That's a far more disruptive change. Also I find the repetition
distasteful. Directories are a better way to organize files than
prefixing filenames. Do you advocate putting all the source files in one
flat directory with very long filenames for each file? Of course not.
> Class name conflicts can be fixed using
> namespaces (OK,OK; nobody in xerces wants to use namespaces...) .
I'd love to use namespaces, but that's just because I have no respect
for old compilers. However, that wouldn't solve the problem of
conflicting header names. That's a different kind of namespace.
> That
> might mean changing also the name of the class, but you will have to do
> it only from time to time, and only if the file-not-in-xerces is so
> common everybody needs to include.
It's a mistake to ever believe that you can anticipate the contents of
all 3rd party libraries. That's why we have namespaces and directories,
and it's why decent C libraries use prefixes.
> In any case, there's another fix to filename conflicts: use prefixes;
> most libraries nowadays prefix class and library names with a,
> preferably uncommon, name. But that would mean renaming each and every
> file, and would be as bad, or worse, than changing a directory name.
Most classes in Xerces *are* prefixed with DOM, DOM_, or SAX_, etc. I
think there are still a few with very generic names in the global space
but I don't remember which ones they are.
--
Murray Cumming
www.murrayc.com
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]