473,385 Members | 1,344 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,385 software developers and data experts.

What happens with Xml Serialization and Private members

Jax
Just to confirm.
If I have object foo:

public class foo
{
private string myPrivate;
protected string myProtected;
public string myPublic;

public class foo()
{
myPrivate = "You cant see this!";
myProtected = "Only family can see this";
myPublic = "This is for everyone";
}
}

If that is serialized using xmlserialization only myPublic will be actually serialized in the file.
The next part is what I want to confirm.
When an object is deserialized the type needs to be passed in as well, Is it that becuase serializer needs to read the type to inputs the default value for the private fields when they get back?
Also i'm interested in finding out why XmlSerialization doesn't cover anything private or protected, anyone got any info?

Many thanks
Jax
Nov 15 '05 #1
0 1836

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Anuj Gupta via .NET 247 | last post by:
Can anyone please suggest 'why it is must to have a defualt constructor while serializing a class using XMLSerializer'? -------------------------------- From: Anuj Gupta ...
3
by: Aaron Clamage | last post by:
Hi, I'm not sure that if this is the right forum, but any help would be greatly appreciated. I am porting some java serialization code to c# and I can't figure out the correct way to do it. ...
2
by: Dominic | last post by:
Hi everybody, I'm planning to use serialization to persist an object (and possibly its child objects) in my application. However, I'm concerned about the backward compatibility issue. I'm...
4
by: Alexander | last post by:
There was such problem, At compilation with SP1 (dotnetfx11SP1) On computers without him{it} недесериализуются some objects. For example (System. Collections. Comparer) and together with...
3
by: Alex Nitulescu | last post by:
_______________________________________________________________________________________ System.IO.FileNotFoundException: File or assembly name biypfduw.dll, or one of its dependencies, was not...
10
by: SStory | last post by:
My app is near completed for the basic feature of version 1.0. I have an extensive object model and I now want to persist my objects using serialization. I have chosen binaryformatter to...
0
by: Shane Story | last post by:
My other thread on serialization seemed to be stagnant and I still have questions, so I decided to post this example of what I need to know. I am trying to use binaryformatter. I have no trouble...
6
by: DBC User | last post by:
Could someone help me understand 'Serializable'? What is this 'Serializable' why do we need it and how do we use it? Any link or simple example would be great.
0
by: bharathreddy | last post by:
Before going to that i want to say few thing on serialization : Serialization is the process of converting an object into a form that can be readily transported. For example, you can serialize an...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.