473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Why Do we need Serialization?

Hi there, just digging into serialization a few questions about serialization.
1. Why do we need serialization?
Ans: For transferring the objects or saving the objects in database or file etc.
But why to serialize inorder to transfer the file? We can directly transfer the file if we create the class in separate .cs file and directly send the file to the person required.
2. Where do we implement serialization?
Ans: Remoting
Can any one please give me remoting examples? Coz I am learning everything by my own and require some assistance to learn few things.
Any help is much appreciated. Thanks in advance.
Rakesh.
Aug 24 '10 #1
2 2476
Joseph Martell
198 Expert 128KB
I think you may be misunderstanding the answer to question 1. Serialization is for the transfer of objects, not classes. Source files only hold the class definitions, not actual objects. Serialization provides us a method for transferring instantiated objects from one location to another.

A real-life example of remoting involves accessing restricted resources. If there are 2 servers in a network, one which has access to a specific resource (a file, database, etc.) and the other would like information stored on that resource but lacks access, remoting can provide an amicable solution. An object can be instantiated on the server with access and a proxy can be created on the server that wants information. Commands and information from the proxy are serialized and sent to the remote object where they are executed. The return information is serialized and sent back to the proxy object.

Serialization can also be used as a way to store an object in a particular state and then restore that object to the same state later. This can be useful to store complex objects and between program executions.
Aug 25 '10 #2
Hi Joseph,
Thank you verymuch for correcting my mistake. I was under the wrong impression that serialization is meant for classes. Not the objects. Thank you once again for correcting me.

Thanks
Rakesh
Aug 25 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jeff T. | last post by:
Hello, I have an existing set of C# classes that encapsulate our application data. They are in a heirachy with each subclass defining more specific types of data. I would like to serialize these...
6
by: Uttam | last post by:
Hello, We are at a very crucial decision making stage to select between .Net and Java. Our requirement is to download a class at runtime on the client computer and execute it using remoting or...
3
by: Alexander | last post by:
When i store rule on PC with .NET.SP1 i cant restore them from PC without SP1. An i get this Error: System.Runtime.Serialization.SerializationException: Possible Version mismatch. Type...
4
by: Val | last post by:
I have a complex object that I need to serialize. Rather than rely on a standard routine, which is called during the serialization/deserialization, I would like to be able to use my own functions...
3
by: LW | last post by:
Hi! I am getting the following error message for my fairly simple web service. I have classes and have two DataSets that reference the same classes. The error is: The XML element named...
0
by: nobin01 | last post by:
Dear sir; I want ur Help in serialization.I know serialization.I Know binary,soap and xmlserialization also.But i want ur help in following topics.pls help me as soon as possible.I have search in...
4
by: mijalko | last post by:
Hi, I have inherited my class from System.Drawing.Printing.PrintDocument and I wish to serialize this object using XmlSerializer. And I get exception "There was an error reflecting type ...". If I...
11
by: William | last post by:
I'm looking for an example that would show how to serialize a c++ object at it's simplest w/o using any other api's. I have a class that I want to serialize and then pass to my obj-c class so I can...
2
by: mkvenkit.vc | last post by:
Hello, I hope this is the right place to post a question on Boost. If not, please let me know where I can post this message and I will do so. I am having a strange problem with std::string as...
2
!NoItAll
by: !NoItAll | last post by:
Reading XML in VB.NET is pretty straightforward. Create an XML Document Object, then you can load the XML and iterate through all of the nodes as required. You can search for nodes, use x-path,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.