Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Serialization w/o using Serializable  RSS feed

 
Vishal Dhingreja
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

This is an interview question which I had to face.
I was a bit baffled by it.
Can some one throw some light on this. If possible it would be better if someone gave a small example

Here is teh question

How can serialization be implemented without using the serializable
interface ?

Rgrds
Vishal
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vishal Dhingreja:

How can serialization be implemented without using the serializable
interface ?


May be you can try Transparent object persistance .
Each class has a corresponding table in the database.
When ever you need to serialize the class .. Call a method that stores all the member variables in the table..

So the number of rows in the table corresponds to the number of objects persisted !!

There is an advantage of this too .. Unlike serialization that uses a file to store the object .. sincec you are using a database , more than one user can deserialize the object simultaneously.
[ November 26, 2004: Message edited by: srini vasan ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!