[Biojava-l] Serializable
Thomas Down
td2@sanger.ac.uk
Tue, 6 Nov 2001 15:45:36 +0000
On Mon, Nov 05, 2001 at 03:31:04PM +1300, Schreiber, Mark wrote:
> Hi -
>
> I have noticed that serialization is sporadically and poorly supported,
> some classes that implement the Serializable interface aren't
> serializable because some of their members are not. Some inner classes
> are serilizable whereas the outer class isn't so effectivley the inner
> class isn't either.
>
> I am going to commit a fixs to some of the problems I have noticed
> however we should have a think about this as cool java things like RMI
> and EJB seem to depend on serialization.
Hi...
I've also been noticing serialization issues recently -- especially
related to serialization of Distribution objects, which is quite
important to some work I'm doing at the moment.
Since a lot of the BioJava APIs are, as you say, nominally
serializable, I think we should be including some serialization
test-cases in the main test suite. I'll try to make a point
of writing serialization tests for any code I modify from now
on -- a few people doing this and we should have perfect
serialization pretty quick :-).
Going back for a moment to the Distribution serialization issue,
this seems to be very problematic right now, especially for things
which rely on AlphabetIndexers (we're currently assuming that
the indexer will be stable across serialization-deserialization
of an alphabet, but this is actually very, very, dangerous). I'm
now quite tempted to write custom serializers. Any distribution
over a FiniteAlphabet should just be serializable as
symbol-weight tuples. No dependance on indexers, and we ought
to be able to use the same code for all the different implementations
(maybe put it in AbstractDistribution). What do you think?
Thomas.