It’s not clear to me when should one use serialization / deserialization techniques
Can anybody provide me some basic use case scenarios?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Serialization is the process for turning an object into some kind of encoded representation to move it from one place to another. Usually, it’s the process of turning an object into something like a byte array or XML string, though you could serialize to other formats if you wanted to.
The most common use of serialization is when you need to move an object across process, machine, or, more precisely, AppDomain boundaries. So if you want to send an object from Server A to Server B, you’d have to serialize the object on Server A, then send that encoded representation of the object to Server B, and have Server B deserialize the object in order to use it on the other end.
Not all objects are easily serializable — for example, objects which have pointers in memory to some location on a server probably won’t make sense if the pointer is sent to another server. In a case like this, you would have to write your own custom logic to determine what to do with that pointer. Perhaps you wouldn’t serialize that property of your object at all… Perhaps you’d also serialize what the object that the pointer points to — it’s going to be up to you. That’s why serialization isn’t always easy or automatic.