[Biojava-l] Re: Biojava-l digest, Vol 1 #117 - 3 msgs

Taejin Ahn tj@bric.postech.ac.kr
Tue, 1 Aug 2000 11:20:10 +0900


> Dear all,
> 
> I am confused about serialization. Some BioJava objects need to have
> transient fields. When the object is de-serialized, these fields will be
> null. Does anybody know what methods I need to provide to set up the
> transient fields to usefull values during deserialization?

As far as I know, transient or static field can not be serialized nor de-serialized.
It's content should be null when de-serialized.
Sadly, I think there is no way to serialize transient or static field. 
I hereby link JAVA tutorial mentiond about it.
http://java.sun.com/docs/books/tutorial/essential/io/providing.html
please refer "Protecting Sensitive Information" subject there.

=================================
I worship you..
The reason I live is to worship you
Tae-Jin Ahn
http://bric.postech.ac.kr/~tj
018-528-6040
0562-279-8194
================================= 
----- Original Message ----- 
º¸³½ »ç¶÷: <biojava-l-request@biojava.org>
¹Þ´Â »ç¶÷: <biojava-l@biojava.org>
º¸³½ ³¯Â¥: 2000³â 8¿ù 1ÀÏ È­¿äÀÏ
Á¦¸ñ: Biojava-l digest, Vol 1 #117 - 3 msgs


> Send Biojava-l mailing list submissions to
> biojava-l@biojava.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> http://biojava.org/mailman/listinfo/biojava-l
> or, via email, send a message with subject or body 'help' to
> biojava-l-request@biojava.org
> 
> You can reach the person managing the list at
> biojava-l-admin@biojava.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Biojava-l digest..."
> 
> 
> Today's Topics:
> 
>   1. serialization (Matthew Pocock)
>   2. Re: serialization (Thomas Down)
>   3. More fixes (Matthew Pocock)
> 
> --__--__--
> 
> Message: 1
> Date: Sun, 30 Jul 2000 19:09:19 +0100
> From: Matthew Pocock <mrp@sanger.ac.uk>
> Organization: The Sanger Center
> To: "biojava-l@biojava.org" <biojava-l@biojava.org>
> Subject: [Biojava-l] serialization
> 
> Dear all,
> 
> I am confused about serialization. Some BioJava objects need to have
> transient fields. When the object is de-serialized, these fields will be
> null. Does anybody know what methods I need to provide to set up the
> transient fields to usefull values during deserialization?
> 
> Thanks
> 
> Matthew
> 
> --
> Joon: You're out of your tree
> Sam:  It wasn't my tree
>                                                  (Benny & Joon)
> 
> 
> 
> --__--__--
> 
> Message: 2
> Date: Mon, 31 Jul 2000 10:41:04 +0100
> From: Thomas Down <td2@sanger.ac.uk>
> To: Matthew Pocock <mrp@sanger.ac.uk>
> Cc: "biojava-l@biojava.org" <biojava-l@biojava.org>
> Subject: Re: [Biojava-l] serialization
> Organization: This tangled web on which I'm laid intwined
> 
> On Sun, Jul 30, 2000 at 07:09:19PM +0100, Matthew Pocock wrote:
> > Dear all,
> > 
> > I am confused about serialization. Some BioJava objects need to have
> > transient fields. When the object is de-serialized, these fields will be
> > null. Does anybody know what methods I need to provide to set up the
> > transient fields to usefull values during deserialization?
> 
> My understanding is that transient fields aren't necessarily
> null-initialized, they get whatever value is set in the class
> initializer.  But in any case...
> 
> Are there any specific instances you're thinking of.  The
> case that comes to mind is Maps and things in objects which
> implement caching.  The easy solution is.
> 
> public class ObjectWhichNeedsCaching implements Serializable {
>   private transient Map myCache;
> 
>   protected Map getCache() {
>     if (myCache == null)
>       myCache = new HashMap();
>     return myCache;
>   }
> }
> 
> Are there any cases in BioJava where this pattern isn't going
> to work?  There /is/ also a method which can be called when an
> Object is deserialized (can't remember offhand, it's in the
> Serialization specs though), but I wouldn't recommend it unless
> it's really needed.
> 
> ttfn,
> 
> Thomas (car being sorted out at the moment)
> -- 
> One of the advantages of being disorderly is that one is
> constantly making exciting discoveries.
>                                        -- A. A. Milne
> 
> --__--__--
> 
> Message: 3
> Date: Mon, 31 Jul 2000 12:39:15 +0100
> From: Matthew Pocock <mrp@sanger.ac.uk>
> Organization: The Sanger Center
> To: "biojava-l@biojava.org" <biojava-l@biojava.org>
> Subject: [Biojava-l] More fixes
> 
> Thanks to Hilmar for pointing out a bug in fasta writing (space after >
> shags some programs). He also mentioned that HashSequenceDB.IDMaker is
> usefull outside the scope of HashSequenceDB. So, I have added the
> interface org.biojava.bio.seq.db.IDMaker, which replaces this
> functionality. With a bit of trickery, this change is run-time
> compatible with old code except for if you have serialized the byName or
> byURN constants. HashSequenceDB.IDMaker will be removed totaly for 1.0,
> but will remain for the release candidate builds.
> 
> Matthew
> 
> --
> Joon: You're out of your tree
> Sam:  It wasn't my tree
>                                                  (Benny & Joon)
> 
> 
> 
> 
> --__--__--
> 
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l@biojava.org
> http://biojava.org/mailman/listinfo/biojava-l
> 
> 
> End of Biojava-l Digest_______________________________________________
> Biojava-l mailing list  -  Biojava-l@biojava.org
> http://biojava.org/mailman/listinfo/biojava-l
>