Solved

Serialization

Posted on 2002-04-02
5
296 Views
Last Modified: 2010-03-31
What is Object Serialization..??
What exactly happens when we serialize objetcs..and when to use serialization of objects.
0
Comment
Question by:yrrm
5 Comments
 
LVL 3

Expert Comment

by:msterjev
ID: 6915254
0
 

Author Comment

by:yrrm
ID: 6962102
No explanation was provided and the sites suggested by the expert was not helpfull to me.
0
 

Accepted Solution

by:
robin_at_mri earned 50 total points
ID: 7784361
I am learning O.S. myself right now but here is what I have come up with so far.  Object Serialization is a STANDARDIZED way to save an object.  Each object basically has all of it's primitives stored and then the member objects are stored based on their primitives and so on.  The file structure I am sure is organized in a less than linear fashion.  Once an object is serialized once, only a reference to it gets serialized after that.  Also you can specify what variables get serialized, if you call a variable "transient" then it will be ignored by the serializer.  Each object is converted to a stream of bytes on the simplest level that is then stored in a "Stream" which is more or less like a pipe that will spit the bytes back out, either to a file, or over a socket, etc. etc.  So you could store something by a line like
s.writeObject(myCustomObject); which would write out all of the details of the object as a sequence of bytes.  Each object is prefixed by a class declaration that says what type of class it is.  This declaration is based on a variable called serialVersionUID.  i.e.

static long serialVersionUID = 200320032003200301L;


This is a unique id for the class.  If you do not specify manually a new one will be created randomaly each time you serialize a class.  OS is so cool because all you have to do is to say s.writeObject(myClass); and all of the work is done for you.  Am still learning, have you learned much more about this since you posted to the exchange?


Rob
0
 
LVL 9

Expert Comment

by:Venci75
ID: 7932655
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Answered by: robin_at_mri
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venci75
EE Cleanup Volunteer
0
 

Expert Comment

by:SpideyMod
ID: 7984172
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question