OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: Mapping: Schema - Java

[ Lists Home | Date Index | Thread Index ]
  • From: "Jonathan Borden" <jborden@mediaone.net>
  • To: <xml-dev@xml.org>
  • Date: Wed, 8 Mar 2000 16:24:27 -0500

RE: Mapping: Schema - JavaBox, Don wrote:

[ Oliver Becker wrote:]

>>
>> I wonder if somebody has defined (or even implemented) a mapping
>> from XML Schema to Java, i.e. how does Java classes look like which
>> can contain data represented in XML and constrained by a XML Schema.

>The SOAP/1.0 protocol was designed with exactly this in mind. Check out
Section 8 of the SOAP spec
>(http://search.ietf.org/internet-drafts/draft-box-http-soap-01.txt). There
is a Java/SOAP serializer at
> http://www.develop.com/soap. Once I finish my book manuscript on Friday of
next week (yippee), I plan on (a)
> fixing the pending bugs and (b) adding support for schema<->class
compilation.
...
>There are a variety of Java-based "data-binding" proposals out there that
you ought to look at as well. Koins and
> XMOP come to mind, but I am sure there are others.

    Let me elaborate a bit on this:

First (and most important) XML schemas are designed to represent XML
documents. It is not clear to me that the XML Schema language is the best
way to represent Java (or C++, python, javascript,CLOS etc etc) classes.
Though you *can* represent an arbitrary class using an XML Schema, there is
no need to use this XML object model for every object in the universe.

IDL variants (e.g. CORBA, MSCOM) exist to describe interfaces in a
programming language neutral fashion. The design of the XMOP DTD (circa 1998
and hence pre XML Schema) was intended to provide an XML representation of
IDL.

At first glance, it may seem logical to use the XML Schema definition
language to represent Java classes. Is this really so? I submit that the
logical "object model" of  XML Schema is the DOM. Just as every Java class
ought not be an extension of the DOM, an XML description of a Java class
need not be done in the XML Schema language.

XMOP was designed as a language neutral object serialization/description
language. It can be used to pass objects (by value) between javascript, Java
and C++/COM systems.

I have recently integrated XMOP with SOAP and XML-RPC. The XMOP object
description is transformed via XSLT into a downloadable javascript proxy for
a SOAP or XML-RPC method call. Versions are included which run under
Apache/Tomcat (i.e. Java) and IIS/ASP (i.e. COM). A Cocoon based verion is
under development. This dynamic java compilation environment will also allow
generation of Java class proxies from XMOP descriptions "on the fly".

XML Datatypes are a perfectly valid way to describe Java and C++ etc
datatypes and will be incorporated into the next version of the XMOP Schema.

If there is interest on the group, I would submit to open the XMOP Schema to
an XML-DEV community specification process.

A GPL version of the code is available at:
http://www.grovelogic.com/xmop/xmop.zip
The whitepaper is at http://www.grovelogic.com/documents/xmop.htm

Jonathan Borden



***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS