I have a Class that contains 3 mix-in classes. Each mix-in class contains one collection variable that I need dynamically created. Each mix-in class contains the appropriate Factory::InitSysVars code to do this. However, when I create an instance of my main object, only one mix-in class' InitSysVars code gets ran (the last class alphabetically).
The InitSysVars of the main class after linking in one or more mix-in classes is:
DO $SUPER.(Existence,Knows)Factory::InitSysVars
Should this instead be a loop to handle each superclass' InitSysVars, or is there a reason why it only runs one and I just have to add my own code to run InitSysVars on each superclass?
Thanks,
Mark
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
$Super will only call one ancestor, in the case on multiple inheritence, which ancestor it calls in random (Likey to be consistent for a given set of ancestors, but now following a set rule - Well at least one I can rember).
I would suggest altering the decendant code to call each ancestor independantly...
Indeed you might actually want to post this as a bug... (hmm... hold on that - See below) It would make far more sense to have the code that generated InitSysVars generate specific calls to the ancestor...
Hmmm... On a side note this problem should not occur in 4.1.0.12+ (Which I hope to release within the next week), since I'm deprecating InitSysVars, and replacing it with a new Method called InitAllSysVars which creates the variables for all levels at once in a single call.. This is MUCH faster and resolves problems like this one.
Jerry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have a Class that contains 3 mix-in classes. Each mix-in class contains one collection variable that I need dynamically created. Each mix-in class contains the appropriate Factory::InitSysVars code to do this. However, when I create an instance of my main object, only one mix-in class' InitSysVars code gets ran (the last class alphabetically).
The InitSysVars of the main class after linking in one or more mix-in classes is:
DO $SUPER.(Existence,Knows)Factory::InitSysVars
Should this instead be a loop to handle each superclass' InitSysVars, or is there a reason why it only runs one and I just have to add my own code to run InitSysVars on each superclass?
Thanks,
Mark
Mark,
$Super will only call one ancestor, in the case on multiple inheritence, which ancestor it calls in random (Likey to be consistent for a given set of ancestors, but now following a set rule - Well at least one I can rember).
I would suggest altering the decendant code to call each ancestor independantly...
Indeed you might actually want to post this as a bug... (hmm... hold on that - See below) It would make far more sense to have the code that generated InitSysVars generate specific calls to the ancestor...
Hmmm... On a side note this problem should not occur in 4.1.0.12+ (Which I hope to release within the next week), since I'm deprecating InitSysVars, and replacing it with a new Method called InitAllSysVars which creates the variables for all levels at once in a single call.. This is MUCH faster and resolves problems like this one.
Jerry