PDA

Click to See Complete Forum and Search --> : What is serialization used for? ***SOLVED***


Sgt-Peppa
Jul 9th, 2003, 04:52 AM
I`ve been reading about it in my books but I just don`t know what its good for! Can anyone explain please what to use serialization for?


Thanx Stephan

Pirate
Jul 9th, 2003, 09:22 AM
6.1 What is serialization?
Serialization is the process of converting an object into a stream of bytes. Deserialization is the opposite process of creating an object from a stream of bytes. Serialization/Deserialization is mostly used to transport objects (e.g. during remoting), or to persist objects (e.g. to a file or database).


http://www.andymcm.com/dotnetfaq.htm#Serialization

Sgt-Peppa
Jul 10th, 2003, 02:22 AM
Yeah I know the technical site to it! What I want to know is when do I really use it, and why? I mean I can write to Db or a File or FTP....... without using it. What is the + I get out of serialization?

Thanx,
Stephan

hellswraith
Jul 10th, 2003, 03:16 AM
You could write a bunch of logic to store the values of an object to a file, then a bunch of logic to read those values back in....for each object you would like to persist.

OR

You could just serialize it quickly and easily.


Your choice.
It is there to help us.
It is there to send objects over the network.
It is cool....lol.

Basically, yes, you can do it other ways, but serialization is built in for the most part, and makes your life easier. To say why do it this way when we already have text files and databases is like saying somthing like:
"Why are they creating this new road that is a straight line from here to work when I already have one that twists and turns all over the place, but still gets there?"

Sgt-Peppa
Jul 10th, 2003, 03:35 AM
I never doubtet that there is a sense behind that serialization! I just didn`t know what to use it for! Now, that U explained, I can see the + I`ll get out of that!
Thanx for your explanation,

Stephan