> From: Tim Staley
>To: [email protected]
>Sent: Monday, January 23, 2012 11:47 AM
>Subject: "generateDS" feature requests
> Hi Dave,
> (and Roy since I'm interested in VOEventLib,)
>
> I've been getting to know your code a bit - works very nicely!
> However, I was wondering if I could suggest some alterations /
> extra features?
Super. Hope generateDS.py has been helpful to you.
>
> A couple are fairly trivial (I've hacked them in myself), one maybe
> not so (couldn't manage it!).
>
> Firstly, I was wondering if you could add a command line switch to
> turn off the getter and setter methods generation entirely? I.e. so
> that all data access is required to be of the form
>
> foo.bar=foo.bar+3
>
> rather than
>
> foo.set_bar(foo.get_bar()+3)
OK. I admit that the properties support should be reworked so that
the name of the property is the same as the name of the
child/attribute. But, I am worried a bit about changing it and by
doing so, breaking existing code out there. So, yes, I think we
should do this, but I've got to think about it some.
>
> I realise that currently both methods are valid, but I prefer to
> switch off the second variant (not my style!)
>
> Secondly, I'd like to suggest that the base classes
> "GDSParseError", "GeneratedSuper" have their names prefixed with an
> underscore - This is the python naming convention for classes or
> data that are generally considered "private" (i.e. suggested not
> for public consumption, although there's no enforcing it).
Yes, you are right. We should be trying to avoid name conflicts
with classes generated from xs:complexType and xs:simpleType.
Again, I worry about causing problems for existing code out there,
though I doubt that's likely.
>
> Finally, any chance of shoehorning in a way to customise the member
> data name bindings?
>
> Currently, a class instance typically has the same name as the
> class type, so for example we get
>
> v.WhereWhen=WhereWhen()
>
> I'd prefer the python style of lower_with_underscore for member
> names (which makes it very easy to distinguish instances from the
> class), e.g.
>
> v.where_when=WhereWhen()
>
> I realise this has a con, in that the member data naming no longer
> directly reflects the XML layout, but it's preferable to me (and
> maybe some others too?).
>
> The conversion is easily accomplished using something like:
>
> def map_member_name(caps_name):
> newname_list=[]
> for i in range(len(caps_name)):
> if(i!=0):
> if caps_name[i].isupper() and not caps_name[i-1].isupper():
> newname_list.append("_")
> newname_list.append(temp[i])
>
> return "".join(newname_list).lower()
>
> This "python style member names" could either be turned on as a
> switch, or simply implemented as a do nothing function for the end
> user to re-implement.
That's an interesting puzzle. I wonder if we could enable the user
to provide an expression (or lambda) to perform the mapping. Again,
I'll give it some thought. That would make it even more general.
>
> What do you think? Let me know if you'd like me to stick them in on
> the sourceforge feature request list, or whatever.
>
Tim -
Glad to hear that it's working for you.
And, thanks much for the suggestions. But, right now, I've got a
full time job. I'm programming in Python and having fun at that.
And, they give me free tea everyday. Also, they even pay me. Very
nice. We're saving up for a trip.
This is a short term position, 6 months, and will last another 3
months. So, I'm guessing that I won't get to your requests soon.
But, I will try. And, they're in my queue.
Thanks again for the suggestions. Good ideas are hard to find.
- Dave
-- Dave Kuhlman
http://www.rexx.com/~dkuhlman
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
generateds-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/generateds-users