[Newbies] 'locking' an object
Bert Freudenberg
bert at freudenbergs.de
Thu Oct 2 17:33:38 UTC 2008
Am 02.10.2008 um 10:26 schrieb Randal L. Schwartz:
>
> But the debugger doesn't have any special privileges, and it can
> clearly
> access every inst var, regardless of whether accessors exist or not,
> through
> the magic of #instVarAt: and friends.
There is no magic in #instVarAt:. It exists merely for helping
debugging.
> So code would merely have to execute the equivalent of the
> primitives behind
> #instVarAt: and #instVarAt:put:, and no amount of wrapper class
> would help.
That is not correct. There are no primitives that modify/access
*other* objects. That would break encapsulation.
All you need to do to prevent the debugger from accessing instance
variables is overwriting the methods the debugger invokes.
- Bert -
More information about the Beginners
mailing list