Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!news.kei.com!nntp.coast.net!harbinger.cc.monash.edu.au!news.bhp.com.au!mel.dit.csiro.au!actcsiro!news.nsw.CSIRO.AU!metro!metro!news.cs.su.oz.au!tmx!news.tmx.com.au!news
From: Stephan Meyn <s.meyn@oose.com.au>
Subject: Re: Deriving from nil in VSW 3.0.1
Message-ID: <311ABF7E.660B@oose.com.au>
Nntp-Posting-Host: 203.5.19.198
Sender: news@online.tmx.com.au (System Administrator)
Mime-Version: 1.0
X-Mailer: Mozilla 2.0b6a (WinNT; I)
Content-Type: text/plain; charset=us-ascii
Organization: Object Oriented Pty Ltd
Date: Fri, 9 Feb 1996 03:29:02 GMT
References: <4fcaj4$eq5@news.gem.co.za>
Content-Transfer-Encoding: 7bit
Lines: 41

Peter Shrosbree wrote:
> [snip] 
> I have created a class Proxy derived from nil which catches
> doesNotUnderstand:.  The implementation of doesNotUnderstand: uses
> become: to transform the object into a deserialized version of an
> object in a relational database.
> 
> This works, but I have four concerns:
> 
>    1. After I save my image the sources to the Proxy class become (:))
> garbled.nil is a specialised object (in fact it is a null pointer in the implementation) 
which has ever only one single instance. You are probably confusing the 
Smalltalk system by trying to subclass UndefinedObject.

However I suspect I either misunderstood you or that you actually want to do
something different, ie. have a class that does not have a superclass and, 
as a result not inherit any methoddictionaries.
This is different than being subclass to UndefinedObject.

 
>    2. The CHB does not allow derivation of a class from nil, so I use
> some workspace code to set the superclass with superclass:.  Is this
> ok?  Does it break anything?  What steps should I be going through?Create a subclass from Object. Create two classMethods called unhookSuper
and rehookSuper, which will fiddle with 'super'. After you unhook super
you will have to reinitialize the method dictionaries.

Be aware that you should unhook only the class instance not the 'class class' 
instance. 
 
>    3. After filing Proxy out, I can't file it in again because of the
> problem cited in 2.  I get a walkback popping up recursively
> complaining about superclass: not understood.  I have to kill the
> process to stop it.

rehookSuper before filing out and unhookSuper after filing in.

 
>    4. become: is rather slow.  Does anyone have any suggestions on
> improving its performance?No, there is not much you can do. However, how often does it occur?

stephan
