[Biojava-dev] Potential Enhancements, Defect

mark.schreiber at novartis.com mark.schreiber at novartis.com
Thu Nov 3 22:40:18 EST 2005


I agree with this. If you place implements Serializable on an interface 
you put a pretty heavy burden on the implementor. The next best place is 
on the Abstract class (although this forces every thing that inherits from 
it to be serializable). The very safest place would be on a final class.

Other options include making serialization factories that do their best to 
clone all the information in a (for example) SequenceDB without needing to 
make the SequenceDB serializable. The factory could produce a 
SerializableSequenceDB that implements SequenceDB and Serializable.

- Mark





Kalle Näslund <kalle.naslund at genpat.uu.se>
Sent by: biojava-dev-bounces at portal.open-bio.org
11/01/2005 08:50 PM

 
        To:     Michael McCormick <mmccormi at fhcrc.org>
        cc:     biojava-dev at biojava.org, (bcc: Mark Schreiber/GP/Novartis)
        Subject:        Re: [Biojava-dev] Potential Enhancements, Defect


Michael McCormick wrote:

> Greetings,
>
> Ruihan Wang and I are developing an application that uses biojava in 
> a J2EE environment. We have made a few changes and would like to add 
> them to the biojava code. All of the changes except for one class 
> involve serialization issues. Here is a brief summary.
>
> Please let me know if you are interested in adding these changes and 
> how they should be submitted.
>
> Thanks.
> Mike
>
> Michael McCormick
> Systems Analyst
> Fred Hutchinson Cancer Research Center
>
>
> /org/biojava/bio/search/SeqSimilaritySearchHit should be Serializable
> /org/biojava/bio/search/SeqSimilaritySearchResult should be Serializable
> /org/biojava/bio/search/SeqSimilaritySearchSubHit should be Serializable
> /org/biojava/bio/seq/FeatureHolder should be Serializable
> /org/biojava/bio/seq/db/SequenceDB should be Serializable
> /org/biojava/bio/symbol/Symbol should be Serializable
> /org/biojava/bio/symbol/SymbolList should be Serializable
>
> /

Hi!

Some of the Interfaces you are talking about are realy Core interfaces, 
such as SymbolList. It is used
in many different ways all trough biojava. Some implementations cant 
realy be serialized in a good way.
For example the BioSQL classes that are just proxies for the data inside 
the RDBM. So if you were to take
this type of SymbolList object, serialize it to disk, and load it back 
later, the RDBM might have changend,
and you have a very wierd situation. Similar situations exist for 
FeatureHolder and SequenceDB and so on.

Many of the actual implementations of FeatureHolder, SequenceDB and 
SymbolList and so on implement
Serializable though. So as long as you just use those, you can serialize 
FeatureHolders, SequenceDBs
just fine.

/kalle
_______________________________________________
biojava-dev mailing list
biojava-dev at biojava.org
http://biojava.org/mailman/listinfo/biojava-dev






More information about the biojava-dev mailing list