Change superclass at runtime 
Author Message
 Change superclass at runtime

Hi,

is there a method available to change the superclass of a class that avoids
cyclic inheritance or how can I check cyclic inheritance before I send
setSuperclass: to a certain class?

I use VW7.1

Thanks,
Martin



Mon, 07 Nov 2005 18:38:30 GMT  
 Change superclass at runtime

Quote:

> is there a method available to change the superclass of a class that
avoids
> cyclic inheritance or how can I check cyclic inheritance before I send
> setSuperclass: to a certain class?

> I use VW7.1

You can check the hierarchy using the #includesBehavior: method (e.g.,
newSuperclass includesBehavior: subclass). However, why do you want to set
the superclass? Can't you use the normal class creation  messages? They
already check for cyclic inheritance (see BehaviorBuilderRecord>>verify).

John Brant



Mon, 07 Nov 2005 22:52:13 GMT  
 Change superclass at runtime

Quote:

> Hi,

> is there a method available to change the superclass of a class that
> avoids cyclic inheritance or how can I check cyclic inheritance before
> I send setSuperclass: to a certain class?

> I use VW7.1

User-level class modifications are normally done by ClassBuilder, so there
is no such public method.  The check is hidden inside ClassBuilderRecord,
but it is trivial to do by yourself.  If you assume that there is no
circularity at the start, then the only class that can introduce it is the
one you are about to change--meaning the test is

    newSuperclass withAllSuperclasses includes: aClass

--
Vassili Bykov [|] vassili "at" parcplace "dot" com
VisualWorks Engineering, Tools Technical Lead
[:s | s, s printString] value: '[:s | s, s printString] value: '



Mon, 07 Nov 2005 23:15:38 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Using methods in the superclass' superclass

2. Changes in superclass are not reflected in subclasses.

3. Changing list view at runtime?

4. changing menues at runtime in VW ?

5. changing menues at runtime in VW ?

6. change control tab order at runtime

7. changing file directory at runtime without using a variable in prop:name

8. Changing file attributes at runtime

9. Changing list box columns at runtime

10. Changing input field picture format at runtime?

11. Changing Picture string at runtime

12. Changing Required attribute at runtime

 

 
Powered by phpBB® Forum Software