Hello,
I have been reading up on unnamed namespaces in the context of hiding
classes as mentionned by the GOF Facade pattern description. I was
hoping someone could shed some light on this.
I would like the following classes where Facade has access to Alpha
and Beta which are otherwise hidden.
class Alpha
{
Beta b;
// and methods which call b methods
};
class Beta
{
Alpha a;
// and methods which use a methods
};
class Facade
{
// various manipulations of Alpha and Beta objects
};
However I would like to be able to seperate these classes into
seperate files (as in the case of say a compiler with a facade, the
subsystem classes are numerous and large and keeping this in one file
would be crazy). Is this at all feasible with unnamed namespaces as
the GOF book describes? My major problem is the organisation of the
code in headers and source files. On this front I'm totally lost!
NB: Yes I know I could always do this with private constructors and
friend classes but I would like to see a namespace version in action.
Any help would be greatly appreciated.
Many Thanks
Anthony