Re: Is encapsulation deprecated in ObjC?
Re: Is encapsulation deprecated in ObjC?
- Subject: Re: Is encapsulation deprecated in ObjC?
- From: Ondra Cada <email@hidden>
- Date: Thu, 16 Aug 2001 19:08:18 +0200
Brian,
>
>>>>> Brian Hill (BH) wrote at Thu, 16 Aug 2001 11:58:33 -0500:
BH> For example, if I have a class with a *really private* instance variable
BH> that really should never, ever be accessed outside the instance, you can
BH> implement the 'get' and 'set' methods that key value coding will look
BH> for and use appropriately.
Definitely. That's why I've written
OC> (Actually, it is questionable whether it does violate encapsulation or
OC> not;...
The thing is that it kind of changes the approach: normally, a property is
private (well, protected -- unimportant here, I guess) unless said otherwise.
With key/value, the property is (by a *QUITE SPECIAL WAY*, which is IMHO
very important) public, unless you said otherwise (by implementing some
methods).
Again, anybody has to decide by himself whether it does deprecate
encapsulation or not.
(Well, _I_ think it does not, rather, but de gustibus non est disputandum!)
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc