473,662 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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<Chi ld2> 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 1554

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

Similar topics

1
2614
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 sensitive to the order in which I declare elements in my XML Schema file. In my upcoming project I need a robust XML support, and I wanted to give Python a try, unfortunately I'll probably have to switch back to Java for this project :(
4
8014
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 in "Learning Python" by Mark Lutz and David Ascher. It seems like they are a relatively new feature... It seems to me that any truly OO programming language should support these so I'm sure that Python is no exception, but how can these be...
16
2080
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 that binds a new value to the name "None" is now a syntax error. """ So, what's the implications of this? I find the lack of explanation a
4
4085
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 web page from the VS2003 ASP page designer, extracting an XML document from SQL Server during Page_Load, then adding asp:TableRows & asp:TableCells one at a time / loading the corresponding xml values a cell at a time. Is there a better (less...
6
1888
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 that describes this. Here's the setup. We have a COM server, written in Python. For completeness, here is the script: ----- testserver.py ----- import pythoncom
29
2767
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 datetime (surprise), which then translates into a string like '2005-08-03 07:32:48'. No problem with that -- all works quite nicely, until you try to put data back the other way.
1
4553
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" com.ibm.db2.jcc.DB2Binder -url xxx -user xxx - password xxx -s xxxx DB2Binder stopped: Failure to create connection for binding SQL code: -99999
18
7418
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 Python, and my own experiments confirms this. I could imagine this to become a problem for very large datasets. How good is the integration with MySQL in Python?
162
10223
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 prefix them with 2 underscores, but I hate prefixing my vars, I'd rather add a keyword before it. Python advertises himself as a full OOP language, but why does it miss one of the basic principles of OOP? Will it ever be added to python?
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8343
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8856
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8762
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7365
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5653
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.