incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christophe Lombart <christophe.lomb...@gmail.com>
Subject Re: [jcr-mapping] persistence of the mapping model
Date Thu, 04 Aug 2005 22:57:01 GMT
> Hello Christophe,
> 
> the general advantage I see is, that you can have a better error
> handling in comparison to a DTD.
> In my opinion: the earlier the user find an error in the XML file the
> better is it. With the XML schema
> you have more possibilities than with a DTD because it is a superset of
> a DTD.
You mean Xml schema is a superset of a DTD - of course but I found the
proposed tools (XmlBean, JAXB, ...) not very usefull in our case. They
add some complexity.
Did you see the number of generated classes you have ? 

I will have something 5 classes with 2/5 attributes in each of them.
I'm not sure it is quite complex to write by hand (with eclipse).

> Beside obvious advantages (like XML schema uses the XML syntax) as a
> concrete example we can
> use some build in data types like QName, ID, IDREF directly with the
> schema. Or for the JCR
> date types we can use the double, date, long, boolean schema types.
> A binding framework can do the conversions. Which means, once we defined
> a double or any other
> datatype in the schema we don't need to deal with parsing, validation or
> conversion from string
> to the according data type. The type will simply be available in the
> Java bean.

See in my prototype, it is the same situation 

> o writing Java objects as nodes to the repository
> o loading nodes from the repository into Java objects
> o generating node types out of Java classes
> o generating Java classes out of node types
> o ...
I don't see why it is not possible in my case.
Please, look at tools like OJB, Hibernate & Jackrabbit. Let me know
why they are not using XMLSchema. They have the same problem.
Look at my last commit and let me know what's is wrong in this prototype. 

I think it done with a small amount of code and without generated classes : 
* DescriptorReader : read the mapping File by 5 using a small amount
of classes (see in org.apache.portals.graffito.jcr.mapper.model).
* See the GenericConverter to see how the mapping is done.

Mime
View raw message