[Biojava-l] persistence for org.biojava.bio.seq and org.biojava.bio.symbol
Thomas Down
td2@sanger.ac.uk
Thu, 27 Apr 2000 10:20:54 +0100
On Thu, Apr 27, 2000 at 10:10:10AM +0100, Tom Oinn wrote:
>
> Surely the best way to store your data structure for later use by the
> same tool (or other biojava based code) would be to serialize the
> sequence object (either to disk or as a blob in oracle etc.). This is
> trivial, platform independent (subject to use of biojava on that
> platform) and pretty robust.
Yes, I'd agree that Serialization is probably the right way
to go, unless you particularly need a method of interworking
data with non-Biojava tools.
Serialization support is a goal for biojava, but it's not
fully implemented yet. The main issues are that Biojava
relies heavily on the uniqueness of some critical singleton
objects: for instance, there should only be one instance
of the DNA alphabet in a given virtual machine. Similarly,
there should only be single instances of each of the Symbols
in the well-known alphabets.
Some time ago, I implemented some trickery which should
allow well-known alphabets and symbols to be serialized
safely. What /hasn't/ been done is to go through and
add `implements Serializable' to other classes which
WILL serialize safely, but haven't actually been tested.
SimpleSymbolList, for instance, probably falls into this
category.
>From now on, it's probably worth making a point of making
all the core BioJava objects serializable.
Happy hacking,
Thomas.
--
There are whose study is of smells
And to attentive schools rehearse
How something mixed with something else
Makes something worse.