> From: Sasha Case

> To: Dave Kuhlman <dkuhl...@rexx.com>
> Sent: Thu, July 29, 2010 8:53:28 PM
>
> Dave,
> 
> Thanks for your reply.  After reading the fragments of the XML spec that
> you posted and also looking closer at how generateDS would probably handle
> the case, I have opted to instead modify the schema.
> 
> I think that it becomes too complicated to try to handle the special cases
> that you have raised, such as multiple maxOccurs occurences nested within
> each other, and then trying to inherit all of these down to the actual
> repeated element.  Too confusing!
> 
> So I have just modified our schema to be simpler, and now everything works
> as I expect!  This is a very nice piece of software that you have put
> together.

Sasha -

Great.

> 
> I do have one more question if you have any time to answer..
> 
> With the property support (-m), a whole lot of properties are created with
> names like nameProp, addressProp, etc.  This makes using the generated
> classes much nicer, but I think it would be neater to call the property
> just eg. 'name' and 'address'.  This would clash with the existing names
> used to store the actual data, however these would then be better called
> _name and _address as is conventional for pseudo-private variables.  I'm
> sure that you have considered this before - perhaps you have not done it
> this way for legacy/backwards compatibility reasons from before Python
> supported properties...?  Do you think it would be trivial for me to do a
> search/replace in generateDS.py to set all 'internal' attributes to lead
> with an underscore, and rename all the generated properties to remove the
> 'Prop' suffix?

You are right about how properties should be.  The property name
should be the same as the element or attribute name.  And, that
change should be very easy to make, I believe.  It's all in
function generateGettersAndSetters() in generateDS.py.

But, yes I do worry that changing this might break someone's code,
although I don't think that is too likely.  Still ...

When I changed the naming convention for getters and setters (for
example, from getName() to get_name()), I implemented a command
line option (--use-old-getter-setter) that could be used to
generate the old code.  What if we had a --use-old-properties
command line option?

Give me a day or two to look into it.  I'll report back.

- Dave


 -- 

Dave Kuhlman
http://www.rexx.com/~dkuhlman

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to