Opinion on XML data access

  • Thread starter Thread starter p0
  • Start date Start date
P

p0

Hello,

I'm looking on opinions on data access in .Net. I have an xsl file
containing a xsl:variable with child nodes. I want to create a GUI to
manipulate the content of these child nodes.

Should I load the node in memory as an XmlNode and manipulate its
content directly for every get/set operation? Or should I
'deserialize' the node into several data classes and 'serialize' at
the end of all the getting and setting?

From a performance point of view, neither of those two options should
form a problem. I'm just wondering about 'good practice'.

TIA,

Yves
 
p0 wrote:

Should I load the node in memory as an XmlNode and manipulate its
content directly for every get/set operation? Or should I
'deserialize' the node into several data classes and 'serialize' at
the end of all the getting and setting?

From a performance point of view, neither of those two options should
form a problem. I'm just wondering about 'good practice'.

I am not sure it is a question of good practice. Use the API you are
more familiar with. If you are familiar with the DOM implementation in
the .NET framework (i.e. System.Xml.XmlDocument/XmlElement/XmlNode) then
you should have no problems in using it for the task. If you have no
experience with the DOM then using XmlSerializer to allow you to work
with instances of custom .NET classes can be much more comfortable.
 
As good practise the latter is in my idea definitly better
(deserialize/serialize) because then your program becomes easier to
understand and therefore to maintain.

Cor
 
Back
Top