Click here to Skip to main content
15,887,477 members
Home / Discussions / C#
   

C#

 
GeneralRe: Read XML Into Class Hierarchy Pin
SledgeHammer0128-Mar-11 6:30
SledgeHammer0128-Mar-11 6:30 
GeneralRe: Read XML Into Class Hierarchy Pin
Not Active28-Mar-11 6:43
mentorNot Active28-Mar-11 6:43 
GeneralRe: Read XML Into Class Hierarchy Pin
SledgeHammer0128-Mar-11 6:50
SledgeHammer0128-Mar-11 6:50 
GeneralRe: Read XML Into Class Hierarchy Pin
Ian Shlasko28-Mar-11 6:53
Ian Shlasko28-Mar-11 6:53 
GeneralRe: Read XML Into Class Hierarchy Pin
Not Active28-Mar-11 7:13
mentorNot Active28-Mar-11 7:13 
GeneralRe: Read XML Into Class Hierarchy Pin
Ian Shlasko28-Mar-11 7:27
Ian Shlasko28-Mar-11 7:27 
GeneralRe: Read XML Into Class Hierarchy Pin
Not Active28-Mar-11 5:58
mentorNot Active28-Mar-11 5:58 
GeneralRe: Read XML Into Class Hierarchy Pin
SledgeHammer0128-Mar-11 6:20
SledgeHammer0128-Mar-11 6:20 
Ok, from your first post, I thought somebody is giving you XML that you have to read in. Now I see it is fully under your control. So I must ask: why do you want to use XML? Don't just use it because you *think* you are supposed to. Use it when its *APPROPRIATE*. It often isn't the right choice. People just think they are supposed to use it.

1) do you need it human readable?
2) do you need it human editable?

Before you answer those two questions, let me clarify... say you want to store application settings in an XML file? Your first answer might be "yeah, I want it totally human readable / editable". Why? Do you really want people going in and mucking around with your data files? Are you going to handle all the cases when it gets misformatted by a human? etc?

Now lets get to the real questions:

3) do you need platform interoparability?

4) is data size a concern? is performance? Remember, once your file grows to any reasonable size, xml becomes REALLY slow. At around 200k, it starts to slow down. At around 500k its quite noticable. At around 1MB, its 3 to 4 seconds of load time.

So, anyways, if you don't care about the human aspect and you don't need platform interoparability then XML is must definitely NOT the right choice. Especially if #4 is a concern.

Your best bet then would be binary serialization which is built into .NET as soon as you add the [Serializable] attribute to your class.
GeneralRe: Read XML Into Class Hierarchy Pin
Kevin Marois28-Mar-11 6:35
professionalKevin Marois28-Mar-11 6:35 
GeneralRe: Read XML Into Class Hierarchy Pin
Pete O'Hanlon28-Mar-11 6:37
mvePete O'Hanlon28-Mar-11 6:37 
GeneralRe: Read XML Into Class Hierarchy Pin
Kevin Marois28-Mar-11 6:43
professionalKevin Marois28-Mar-11 6:43 
GeneralRe: Read XML Into Class Hierarchy Pin
Pete O'Hanlon28-Mar-11 6:50
mvePete O'Hanlon28-Mar-11 6:50 
GeneralRe: Read XML Into Class Hierarchy Pin
Kevin Marois28-Mar-11 6:51
professionalKevin Marois28-Mar-11 6:51 
GeneralRe: Read XML Into Class Hierarchy Pin
SledgeHammer0128-Mar-11 8:20
SledgeHammer0128-Mar-11 8:20 
AnswerRe: Read XML Into Class Hierarchy Pin
Pete O'Hanlon28-Mar-11 6:36
mvePete O'Hanlon28-Mar-11 6:36 
GeneralRe: Read XML Into Class Hierarchy Pin
SledgeHammer0128-Mar-11 10:52
SledgeHammer0128-Mar-11 10:52 
AnswerRe: Read XML Into Class Hierarchy Pin
#realJSOP28-Mar-11 10:03
mve#realJSOP28-Mar-11 10:03 
QuestionDrag and drop not working in windows 7 if application is launched as administrator with UAC enabled Pin
abhinish28-Mar-11 4:09
abhinish28-Mar-11 4:09 
QuestionHow to enable disable Hibernation option by using C# code. Pin
Piyush Vaishnav27-Mar-11 23:33
Piyush Vaishnav27-Mar-11 23:33 
AnswerRe: How to enable disable Hibernation option by using C# code. Pin
Pravin Patil, Mumbai28-Mar-11 1:55
Pravin Patil, Mumbai28-Mar-11 1:55 
AnswerRe: How to enable disable Hibernation option by using C# code. Pin
PIEBALDconsult28-Mar-11 3:01
mvePIEBALDconsult28-Mar-11 3:01 
AnswerRe: How to enable disable Hibernation option by using C# code. Pin
Dave Kreskowiak28-Mar-11 4:17
mveDave Kreskowiak28-Mar-11 4:17 
AnswerRe: How to enable disable Hibernation option by using C# code. Pin
Shameel28-Mar-11 5:34
professionalShameel28-Mar-11 5:34 
QuestionExposing the running assembly to run-time compiled code Pin
Quiltfish27-Mar-11 9:56
Quiltfish27-Mar-11 9:56 
AnswerRe: Exposing the running assembly to run-time compiled code Pin
Bernhard Hiller27-Mar-11 21:14
Bernhard Hiller27-Mar-11 21:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.