Public:BWmeta service/Transformers
From YaddaWiki
Line 3: | Line 3: | ||
== Background and motivation == | == Background and motivation == | ||
- | As of 2010Q4, three versions of BWmeta format and at least three Java models of | + | As of 2010Q4, three versions of BWmeta format and at least three Java models of BWmeta are used in YADDA. |
[[BWmeta service/Java mapping|See here]] for details. | [[BWmeta service/Java mapping|See here]] for details. | ||
Serialization and deserialization is implemented for the following pairs: | Serialization and deserialization is implemented for the following pairs: | ||
Line 17: | Line 17: | ||
|} | |} | ||
- | There are also converters between | + | There are also converters between selected models: |
* Y ↔ DL | * Y ↔ DL | ||
Line 26: | Line 26: | ||
Unfortunately, many mutually-incompatible transformation interfaces are present. | Unfortunately, many mutually-incompatible transformation interfaces are present. | ||
- | It is difficult to understand which transformations are possible, how, | + | It is difficult to understand which transformations are possible, how to combine them, |
which classes should be used for that end and how to instantiate the classes. | which classes should be used for that end and how to instantiate the classes. | ||
A unified interface to all the transformations would be very helpful. | A unified interface to all the transformations would be very helpful. | ||
- | == MetadataTransformerFactory == | + | == <code>MetadataTransformerFactory</code> and transformer interfaces == |
+ | |||
+ | Three different transformer types are present: readers, writers and converters. Each type has a corresponding interface: | ||
+ | * <code>IMetadataReader<T></code> deserializes an object of type <code>T</code> from a <code>String</code> or a <code>Reader</code> | ||
+ | * <code>IMetadataWriter<T></code> serializes an object of type <code>T</code> to a <code>String</code> or a <code>Writer</code> | ||
+ | * <code>IMetadataConverter<S, T></code> converts an object of type <code>S</code> to an object of type <code>T</code> |
Revision as of 15:40, 18 November 2010
Service details | |
---|---|
Name | BWmeta |
Code location (relative to SVN root) | projects/dir/bwmeta-core |
Javadoc | |
Contact person | Jakub Jurkiewicz |
Background and motivation
As of 2010Q4, three versions of BWmeta format and at least three Java models of BWmeta are used in YADDA. See here for details. Serialization and deserialization is implemented for the following pairs:
Repo | DL | Y | … | |
---|---|---|---|---|
1.0.5 | ||||
1.2.0 | ||||
2.0.0 |
There are also converters between selected models:
- Y ↔ DL
Serialization of Y model to BWmeta 1.0.5 is therefore possible through the following chain of transformations:
- Y model → DL model → BWmeta 1.0.5
Conversion from DL model to Repo model is possible through:
- DL model → BWmeta 1.0.5 → Repo model
Unfortunately, many mutually-incompatible transformation interfaces are present. It is difficult to understand which transformations are possible, how to combine them, which classes should be used for that end and how to instantiate the classes.
A unified interface to all the transformations would be very helpful.
MetadataTransformerFactory
and transformer interfaces
Three different transformer types are present: readers, writers and converters. Each type has a corresponding interface:
-
IMetadataReader<T>
deserializes an object of typeT
from aString
or aReader
-
IMetadataWriter<T>
serializes an object of typeT
to aString
or aWriter
-
IMetadataConverter<S, T>
converts an object of typeS
to an object of typeT