XML Is Not Just a Deserialized Object Graph

One of the things I did in my latest version of WSS RSS was add a configuration file. I didn’t just use web.config since WSS has a tendency to overwrite it when you upgrade a new virtual server to support WSS. However, I didn’t go the usual route of parsing the XML configuration information into objects via serialization or some other mechanism. Instead, I just loaded up an XmlDocument and queried it with XPath whenever I need to read configuration information. I do this multiple times per web request (once per web and list in the feed).

This leads me to my point – I’m beginning to think the whole idea of XML serialization is off base. Given an object graph, I can serialize it into XML and then deserialize it into an identical object graph. However, I don’t think I can take an arbitrary XML document and always be able to deserialize it into an object graph. XML concepts like derivation by restriction are difficult to model in a strongly typed object model like CLR’s. And since I have XPath, I don’t think I want to always deserialize my XML into objects – it was much simpler to execute XPath queries than it would have been to manually traverse the object graph or build my own query mechanism.

This entry was posted by DevHawk on May 15, 2003.

Disclaimer

The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion.

AltStyle によって変換されたページ (->オリジナル) /