[Q] Safe way of removing class from system

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Q] Safe way of removing class from system

Chun, Sungjin
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Is there safe way of removing class from system without making
ObsoleteClass? What I found is check whether there're instances of the
class and remove all methods, instance variables and class variables,
and make its superclass as Object, then remove the class and if there's
ObsoleteClass, then I use becomeForward: like this: anObsoleteClass
becomeForward: Object.

I'm not sure my way of removing is correct thing.

Thanks in advance.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFTpInQqspS1+XJHgRAkQuAKCmF8MPtS6BQh2atFqdBP0wz0qAegCgrdYr
u7IwxAul05pgY/v/38y2kC4=
=aii4
-----END PGP SIGNATURE-----

Reply | Threaded
Open this post in threaded view
|

Re: [Q] Safe way of removing class from system

tblanchard
I start by browsing class refs and making sure no code refers to the  
class by name.
Once you've done that, see if you can find out if anything is caching  
instances and get them released.
Then just choose 'remove class'

On Nov 5, 2006, at 5:38 PM, Sungjin Chun wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> Is there safe way of removing class from system without making
> ObsoleteClass? What I found is check whether there're instances of the
> class and remove all methods, instance variables and class variables,
> and make its superclass as Object, then remove the class and if  
> there's
> ObsoleteClass, then I use becomeForward: like this: anObsoleteClass
> becomeForward: Object.
>
> I'm not sure my way of removing is correct thing.
>
> Thanks in advance.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFTpInQqspS1+XJHgRAkQuAKCmF8MPtS6BQh2atFqdBP0wz0qAegCgrdYr
> u7IwxAul05pgY/v/38y2kC4=
> =aii4
> -----END PGP SIGNATURE-----
>


Reply | Threaded
Open this post in threaded view
|

Re: [Q] Safe way of removing class from system

Ramon Leon-4
>>
>> Is there safe way of removing class from system without making
>> ObsoleteClass? What I found is check whether there're instances of the
>> class and remove all methods, instance variables and class variables,
>> and make its superclass as Object, then remove the class and if  there's
>> ObsoleteClass, then I use becomeForward: like this: anObsoleteClass
>> becomeForward: Object.
>>
>> I'm not sure my way of removing is correct thing.
>>
>> Thanks in advance.

You can also just find, and eliminate all remaining references

SomeClass allInstances do: [:each | PointerFinder on: each].

or if you have obsolete classes hanging around, look them up as well

Smalltalk obsoleteClasses do: [:each | PointerFinder on: each].

Once you rid yourself of those hanging references, just do a
garbageCollect and you should be good to go.  I'd be careful with
become, you shouldn't need it.

Ramon Leon
http://onsmalltalk.com