Data Converters
Purpose and Functionality
The data converters are reposible to translate data from one representation into
another. Concrete examples are e.g. converters creating transient objects representing
parts of an event from the persistent (and disk based) representations. Converters will
have to deal with the technology both representations are based on: in the upper example
they have to know about the database internals as well as the structure of the transient
representations. The converters know about the mechanism to retrieve persistent objects
(ZEBRA, Objty,
) and only pass abstract instances of the converted objects, hence
shielding the calling service from internals.
Data converters are meant to be light. This means there should not be all-in-one
converters, which are able to convert the "world", but rather many converters.
Each converter is then able to create a representation of a given type.
In order to function a converter must be able to
- Answer (when asked) which kind of representation the converter is able to create.
- Retrieve the source object from the source store.
- Create the requested transient representation using the information contained in the
source object.
- Initialise pointers in the transient representation of the created object.
- Update the transient representation using the information contained in the source
object.
- Update pointers in the transient representation of the created object.
- Convert the transient representation to its target (e.g. persistent) representation.
- Resolve references within the target representation (persistent references).
- Update the target representation from the transient representation.
- Update references within the target representation (persistent references).
The conversion/creation mechanism of an object into another representation is a two
step process:
- Firstly the "raw" object will translated. This step does not include any links
pointing to other objects.
- At the second step the link will be converted.
Concrete user converters are based on a base class which deals with
the technology specific generic actions. The concrete converters hence only deal with data
internal to the objects like e.g.
- Resolving pointers of the transient objects to objects in the detector description.
- Fill/update contained entries in the persistent representation which will not be
identifiable by the persistent store.
- The base class is in charge of resolving the generic "identifiable" references
as they are accessible from the directory of the transient DataObject. It is understood,
that there is a correspondence between the identifiable entries e.g. in the transient
world and the persistent world.
Interfaces
Each converter must expose the following interface to the data services:
- IConverter:
This interface allows the caller to pass the necessary information to
the converter.