Re: Re:
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: Re:

From: Tom Anderson <twic@urchin.earth.li>
Date: Sat Jul 02 2005 - 16:11:54 CEST

On Fri, 1 Jul 2005, Andreas Kostyrka wrote:

> Am Freitag, den 01.07.2005, 08:25 -0700 schrieb George Sakkis:
>
>>> Again, how? Is there a way to force that an external user of my lib can
>>> not use my internal data/methods/classes, unless he uses odd compiler
>>> hacks?
>>
>> I never understood how mainstream OO languages expect the designer of a
>> class to know in advance that an attribute should be hidden or
>> unnecessary to its subclasses by being declared "private" instead of
>> "protected".
>
> The problem is, that the classic private/protected/public visibility
> tags try to solve multiple problems.
>
> Private: Ok, that's all that's really only for the implementation.
> public: Well, that's all for my "customers". Hmm. What if I've got two
> kinds of customers? Say a customer like in bank customer, and second
> customer that plays the role of the bank employee? oops.

C++ has 'friend' for that:

http://www.cplusplus.com/doc/tutorial/tut4-3.html

tom

-- 
REMOVE AND DESTROY
Received on Thu Sep 29 16:42:35 2005