incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandro Böhme <>
Subject Re: [jcr-mapping] persistence of the mapping model
Date Fri, 05 Aug 2005 23:54:39 GMT
Christophe Lombart wrote:

>>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 ? 
 From all  know XMLBeans uses one implementation class and one interface 
for each type.

>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).
I don't think it will be complex. It will just be some work.

>>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.
Thank you for the information I just didn't know that digester can 
handle custom type structures and
Java types.

>Please, look at tools like OJB, Hibernate & Jackrabbit. Let me know
>why they are not using XMLSchema. They have the same problem.
You don't really want me to search for your arguments why Hibernate use 
a DTD, do you? ;-)
I can tell that EJB 3.0 (I think Hibernate will be a EJB 3.0 
implementation) don't use a DTD
and only use an XML schema and JDO 2.0 will use XML schema in addition 
to a DTD. But
I like more concrete problems and solutions.
I will tell you a joke to explain, why I don't like those arguments. 
Please quote me on this,
in case I also use those arguments sometimes ;-) :

It was autumn, and the Indians on the remote reservation asked their new 
Chief if the
winter was going to be cold or mild. Since he was an Indian Chief in a 
modern society,
he had never been taught the old secrets, and when he looked at the sky, 
he couldn't
tell what the weather was going to be.
Nevertheless, to be on the safe side, he replied to his tribe that the 
winter was
indeed going to be cold and that the members of the village should 
collect wood to be
But also being a practical leader, after several days he got an idea.He 
went to the
phone booth, called the National Weather Service and asked, "Is the 
coming winter
going to be cold?"
"It looks like this winter is going to be quite cold indeed," the 
meteorologist at
the weather service responded. So the Chief went back to his people and 
told them to
collect even more wood in order to be prepared.
One week later he called the National Weather Service again. "Is it 
going to be a
very cold winter?"
"Yes," the man at National Weather Service again replied, "it's going to 
be a very
cold winter."
The Chief again went back to his people and ordered them to collect 
every scrap of
wood they could find.
Two weeks later he called the National Weather Service again. "Are you 
sure that the winter is going to be very cold?"
"Absolutely," the man replied. "It's going to be one of the coldest 
winters ever.
"How can you be so sure?" the Chief asked.
The weatherman replied, "The Indians are collecting wood like crazy."

I just don't want to be the Indian ;-).

>Look at my last commit and let me know what's is wrong in this prototype. 
I will not start a "my prototype is better than yours" ;-). I could not 
yet completely check
advantages or disadvantages.
We should take care not to reinvent the wheel with our two prototypes.

>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.
It's good to see Digester "in action" as an example. I will try to get 
more into that.

Best regards,


View raw message