Recompilation (was: Re: Tips and tricks?)
Andreas Raab
andreas.raab at gmx.de
Thu Mar 11 13:52:41 UTC 2004
> What about mirror-objects? The idea behind this is that you
> factor out all the state-related meta-methods (e.g instVarAt:)
> into it's own class. Then you have an object of this class
> as a meta-object for every object in the sytem. All access to
> state is done via this meta-object. And this happens via message
> sends.
>
> With this you have both: Access all instVars via messages without
> having to expose all your state via accessors. For the user this
> would be totally transparent: "... a ...." is compiled to be
> something like "mirror instVarNamed: 'a'", or even "mirror a".
I might add that the above is precisely equivalent to an indirect pointer
model with the ability to reflect about the indirection ;-)
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|