[interfacekit] Re: BRoster & BWindow

>> A last note:  rather than declare them as members of the classes they 

>> provide access to, I'd like to put them in the BPrivate namespace -- 
>> like BLooperList.  The idea being that if you declare them as class 
>> members, then they have to be in the public interface, and end-users 
>> may 
>> be tempted to use them.
>
>That should turn out to be difficult, since the class is opaque in any 
>case. :-P

How so?  If it's declared within the main class, the interface will be 
right there.  Unless we give the private accessor class methods some 
very obnoxious names, it should be pretty obvious what they do.

>An API user with a sufficent amount of criminal energy can abuse the 
>private class anyway, regardless of whether it lives in the BPrivate 
>namespace or in the class itself.

True enough.  A user willing to go to that length will also make his/her 
own copy of the header, declare themselves a friend and have all the fun 
they want.  The point is more to keep this stuff out of the way -- why 
clutter up the public API headers any more than absolutely necessary?

>> Better to hide them away in BPrivate.
>
>What I find a bit ugly with that solution is that you have to declare 
>the class in the namespace in the public header (even before the 
>definition of the main class).

Yeah, it's a tiny bit ugly, but nothing truly onerous.  I suspect most 
people will hardly notice the four lines of code (total) involved.

e

Necessity is the plea for every infringement of human freedom. It is the 
argument of tyrants; it is the creed of slaves.
        -William Pitt, British prime-minister (1759-1806)


Other related posts: