> is possible to intercept (before writeú all instance variable writes on every > existing objects? > > Ok, I learned more about MetaLinks and it's perfectly possible to intercept > instance variable writes via. installing MetaLink into object instance (cool) > - then I can intercept instvar write, but one problem immediately occurs: > when installing MetaLink into object instance, an original object class is > exchanged to anonymous subclass of the original class - and because typical > #= method is implemented like: > > = > self == anObject > ifTrue: [ ^ true ]. > self class = anObject class > ifFalse: [ ^ false ]. > ... > > then most of #= comparisons in application logic is broken due to "self class > = anObject class" part. > > Is there any way to solve this problem?
Hi, the anonymous class thing only happen when you install an object-centric metalink, i.e. on only one specific object. I also wanted to hide the anonymous class, or maybe to only make it visible for environment tools. I need to talk about that with Marcus. Why not installing your metalink on the classes of your objects, so that all instances are affected but in that case there is no anonymous class migration? If that is not possible, in your case maybe a (temporary) hack would be, in your case, to add a test in the #class method in Object (or wherever it is defined): class |myClass| myClass := self class. ^myClass isAnonymous ifTrue:[myClass superclass] ifFalse:[myClass] But i did not test that and i have no idea of the overall impact. Steven.