aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Serialization and persistance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Serialization and persistance" Watch "Serialization and persistance" New topic
Author

Serialization and persistance

Neo Phesus
Ranch Hand

Joined: Feb 22, 2007
Posts: 71
Hello folks,

Here I am with another question..I am not sure if I sound so dumb

Persistence by which I think, we make the state/value of the object to be persistant across the application. Database is kind of persistance or even writing a file is kind of persistence. I also have an assumption like persistance means that when I power down and power up the machine in which I am running the application, I am still able to retain the values.

Now if my above assumptions/learnings are true, Is serialization a way of persistance? If so whats the difference between serialization and peristance. Or Am I missing some link here...

If its a real dumb question, please excuse me...But I am sure these questions are common in learning phase

Thanks in advance.

Regards,
Neo
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18715
    
  40

Now if my above assumptions/learnings are true, Is serialization a way of persistance? If so whats the difference between serialization and peristance. Or Am I missing some link here...


Serialization is the conversion of an instance to a datastream, and back. There are a few reasons for this. First, it could be so that the object can be transferred across the network. Second, it may be for persistence, so that it may be saved.

Persistance whether to a database, file, or any other store, requires the data to be in a format that can be stored and retrieved. Serialization helps convert objects into such a format.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Anupam Sinha
Ranch Hand

Joined: Apr 13, 2003
Posts: 1088
Atleast to me serialization seems like persistence only to me.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Serialization and persistance