Basic HTML version of Foils prepared March 23 98

Foil 23 Persistence and Serialization

From JavaBeans and Use in ComponentWare Basic Information Track Computational Science Course CPS616 -- March 25 1998. by Nancy McCracken, Geoffrey C. Fox, Wojtek Furmanski


Persistence of an object implies that one can save its value to some permanent store (e.g. a disk) and read it back
This is implemented using Serializable (default saving) or Externalizable (user defined saving)
In saving a Java Object, we save the values of data members but assume that the entity reading back object has access to class definition so that one just needs data member values to define instance
  • Only save public, protected and private members but not static ones as these are defined in class definition
  • transient variables are not saved
  • If you have confidential data declare it as private transient (and define its value in encoded fashion using non transient variables) or use Externalizable Interface



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Nov 29 1998