[Newbies] 'locking' an object

Bert Freudenberg bert at freudenbergs.de
Thu Oct 2 18:36:57 UTC 2008


Am 02.10.2008 um 11:25 schrieb Randal L. Schwartz:

>>>>>> "Bert" == Bert Freudenberg <bert at freudenbergs.de> writes:
>
> Bert> There is no magic in #instVarAt:. It exists merely for helping
> Bert> debugging.
>
> I meant the primitive it invokes.  Encapsulated magic is still magic.
>
>>> 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.
>
>
> Bert> All you need to do to prevent the debugger from accessing  
> instance
> Bert> variables is overwriting the methods the debugger invokes.
>
> Ahh, but a determined outsider could still add methods to the class  
> of the
> object on the fly, hand-compiling them if necessary.

How would that outsider get at the class of the object?

> Unless you're now voting for an immutable method dictionary. :)
>
> -- 
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503  
> 777 0095
> <merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
> See http://methodsandmessages.vox.com/ for Smalltalk and Seaside  
> discussion

- Bert -



More information about the Beginners mailing list