Hi Dave, Hi list,
first of all thanks for working in the adjustments for the attribute references 
we talked about a while ago.
generateDS has been working very well for me since then.

Unfortunately like a couple of days ago I tried to integrate a second, 
generated subclass into my program and came
across some unexpected behaviour.

The setup is as follows.
-generated parent class 'parent'
-two generated subclasses 'subA' and 'subB'

In my own module I'm parsing a xml file according to the base xsd of parent.
My module imports both subclass-modules to either create an instance of 'subA' 
or 'subB' by using
modulesubA.parse(filename) or modulesubB.parse(filename).

The unexpected behaviour while testing this, no matter which parse function I 
call, both will return an
object of the last imported subclass module.
So if my imports look like this:

'import modulesubA'
'import modulesubB'

Both function calls:
'modulesubA.parse(filename)'
'modulesubB.parse(filename)'
will return an object of type 'subB'.

If you change the order of the imports, it will be the other way round.

My initial observation is, that this is due to the assignment of the 
classvariable 'subclass' in 'parent'.
It seems to get assigned from each modulesubA and modulesubB initially while 
importing them and after that the factory function of the main class
will only return objects of the subclass which was assigned there last.

I may have an idea on how this could be solved, but I would like to have some 
opinion or discussion from you first.
I can also provide an minimal example of this but that will take me some more 
time, so I hope it gets understood like I described.
Let me know if you can reproduce this behavior or need me to provide some more 
information.

Thanks & Best Regards
Florian Wilmshöver


------------------------------------------------------------------------------
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to