[Biojava-dev] XML Schema

Mark Schreiber markjschreiber at gmail.com
Tue Jan 13 12:52:38 UTC 2009


Hi -

With JAXB you can annotate the POJOs with JAXB instructions although I
believe if you have a beany object and no annotation you get default
behavior if you don't annotate it. I think you can get a schema from
an object or auto generate objects from a schema (unless it is a bit
complex in which case you might need to put JAXB tags in the schema).

There is no clearcut way to get from biojavax to XML. This is because
of the heavy use of singletons and non-bean like objects in biojavax
(something that BJ3 will hopefully get away from). If you want to make
a custom XML serializer/ deserializer my recommendation would be to
put in a middle (transport) layer of beans that operate like the DTO's
of older EJB designs. They would basically be data holders that you
can generate from biojavax objects and then send to XML. Going the
other way you would generate these beans from XML and then use the
beans to generate biojavax objects (with singletons etc).

- Mark

On Tue, Jan 13, 2009 at 7:46 PM, Ola Spjuth <ola.spjuth at farmbio.uu.se> wrote:
> Hi Mark,
>
> Thanks for the quick answer. Never used JAXB myself; does this procedure
> support generation of an XML schema from code? I assume you will annotate
> the POJO's with JAXB metadata? I usually work the other way around and
> generate my model code from a model (usually based on an XML Schema), I
> guess in the end it boils down to the same result?
>
> Anyway, what is the preferred way of serializing current Biojava(X) objects
> to XML? Via BioSQL in some way?
>
> Cheers,
>
> /Ola
>
> On 13 jan 2009, at 11.24, Mark Schreiber wrote:
>
>> The plan for biojava3 is that most or all of it will be POJO enough to
>> support JAXB binding. The JPA implementation of BioSQL objects in BJ3
>> is already XML compatible as the objects are entity beans and can be
>> transported via JAX-RPC.
>>
>> - Mark
>>
>> On Tue, Jan 13, 2009 at 3:38 PM, Ola Spjuth <ola.spjuth at farmbio.uu.se>
>> wrote:
>>>
>>> Hi,
>>>
>>> Does it exist an XML Schema (or compatible) for Biojava, or even better a
>>> common schema for the Bio* projects? If not, is this in the pipe for
>>> Biojava3?
>>>
>>> /Ola
>>>
>>> _______________________________________________
>>> biojava-dev mailing list
>>> biojava-dev at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/biojava-dev
>
>



More information about the biojava-dev mailing list