472,960 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,960 software developers and data experts.

Data binding to Python Java C[++,#]?

For a couple of years I am using now my own data binding tool that can
create C++ classes from a DTD. At this moment I need to reconsider
this tool since I want to use W3C XML Schemas and need to output to
more languages: C, C++, C#, python and Java. In reviewing existing
tools I came the following preliminary conclusions on which I like
your comments:

- there is no single open source tools capable of supporting all the
mentioned languages on both Windows and linux.
- existing tools generate too complex object models in the target
language for type of documents I am processing (see below).

The type of documents I need to process have schema's designed by
myself and only the elements and attributes are significant. Others
things such as processing instructions are ignored, except of course
the relevant info in the Document Type Declaration. The type of
schema's I am designing do have a number of restrictions that makes
mapping to an object model easy:
1) mixed content elements are not allowed
2) sibling elements can only have the same name if they are direct
neighbors
3) if an element has an attribute named X it can not have an child
element named X.

The restrictions do make for easy name selection in the target object
model. For example:

<El Attr="1.34">
<Child1/>
<Child2/>
<Child2/>
</El>

to C++:

class El {
double d_Attr;
Child1 d_Child1;
std::vector<Child2> d_Child2;
......
};

Note that the actual implementation has a more complicated definition
of the child types to get control over it contents. E.g. even a simple
double like Attr is actually wrapped in some sort of set/get mechanism
that can validate, serialize and deserialize the value.

The tool should generate an easy to use object model in the target
language with as little knowledge required by the client programmer
besides the structure of the object model itself. In other words,
minimizing knowledge on XML issues, DOM tree processing, etc. The
generated code should catch validation errors as soon as possible:
some already at a possible compilation, others at executing phase. I
do assume for each target language and operating system a DOM Api and
xsd validator to be present and callable from the generated language.

Performance is not an issue, the documents are assumed to be small.
All processing in my current tool is done using DOM with excessive
copying and cloning around to keep things small from a tool
development perspective.

I am aware of existing tools for Java (Castor) and Python (Amara) and
commercial tools supporting C++ and C# (MS SDK). But I am considering
to create such a tool that can target all languages myself, maybe by
wrapping existing tools, and release it as an open source project. Of
course the first questions then are:

- Is there are already something familiar out there I can join?
- Is there a commercial tool I must consider for efficiency/time
reasons?
- Has anyone experience in targeting multiple languages, by using
probably multiple tools?
- If not, who is interested in such a tool? Or are my requirements too
specific?
- What other newsgroups, mailing lists, SIG's are a suitable platform
to discuss my questions and ideas?

I stop here with describing my existing and wished tool, although I do
have already a lot of specifications and things on my wish list where
such a Data binding generation tool should go to. For example, the no
"mixed contents allowed" restriction can be dropped, by including
generic XML trees that are can be kept and set, but need straight DOM
or SAX processing with little help from the generated object model.

Thanks for your time.

Cees Wesseling
Jul 20 '05 #1
0 1524

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Przemyslaw Wegrzyn | last post by:
Hi! I'm quite new to Python. Is there anything like Castor or JAXB available for Python ? All I have found is generateDS.py, but it seems to be very limited and a bit buggy - it seems to be...
4
by: Neil Zanella | last post by:
Hello, I would like to know whether it is possible to define static class methods and data members in Python (similar to the way it can be done in C++ or Java). These do not seem to be mentioned...
16
by: gaudetteje | last post by:
I just read in the 'What's New in Python 2.4' document that the None data type was converted to a constant: http://python.org/doc/2.4/whatsnew/node15.html """ # None is now a constant; code...
4
by: Greg Linwood | last post by:
I am wondering what the best approach to binding XML data to an asp:Table from the Page_Load event in a code behind module? I'm using VB.Net and initially approached this by adding a table to the...
6
by: Tim Roberts | last post by:
I've been doing COM a long time, but I've just come across a behavior with late binding that surprises me. VB and VBS are not my normal milieux, so I'm hoping someone can point me to a document...
29
by: dyork | last post by:
When getting data from a database using the dbapi and an SQL query, how do you in general round trip the data? Especially date-time? An SQL datetime column translates nicely into a Python...
1
by: db2group88 | last post by:
Hi, we are using db2 ESE v8.2.3 on windows, i try to use command window to do binding D:\Program Files\IBM\SQLLIB\bnd>java -cp "D:\program files\ibm\sqllib \java\db2jcc.jar"...
18
by: Jens | last post by:
I'm starting a project in data mining, and I'm considering Python and Java as possible platforms. I'm conserned by performance. Most benchmarks report that Java is about 10-15 times faster than...
162
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.