Jody Garnett a écrit :
> But martin I thought JaxB was not up to all the uses we have for XML? 
> There is a seperate Java project on JaxB bindings for all the OGC stack; 
> I ignored it at the time but perhaps you would be interested?

They are not exclusive. With JAXB annotations, we are basically saying "if you 
want to serialize yourself in XML, there is a format". Peoples use it or not.

I'm seeing JAXB annotations like java.io.Serializable. Lets imagine that the 
Serializable marker interface is replaced by a @Serializable annotation. We get 
the same thing in a different way. The main difference is that annotations have 
more capabilities, which are needed for XML formatting.


> My question is how do we annotate the same class for two different XML 
> serializations?

We can not with JAXB as far as I known. For those ones, peoples need to use an 
other approach (Justin's parser, or JAXB data-transfert classes).

java.io.Serializable supports only one format as well. Nevertheless they still 
useful for RMI and other usages. With JAXB we are just saying "this class is 
serializable in XML - use it or ignore it". We annotate classes on an 
oportunist 
basis because they already exists - we do not create any data-transfert classes 
inside the GeoTools project. This is like adding "implements Serializable" to 
existing classes: must users will never use this serialization mechanism, but 
those we do appreciate having it.

It can not be a cause of conflict with other frameworks using annotations like 
Hibernate, because annotations are fully qualified like any java classes. Even 
if a Hibernate annotation have the same name than a JAXB annotation, it will 
have a different package name.

        Martin

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to