Shailesh Jaiswal
Shailesh Jaiswal

Reputation: 3654

Whether to use the XML Serialization or simple LINQ to XML for XML database in windows phone 7?

I am developing window phone 7 application. I am new to the window phone 7 application. I am also new to the XML Serialization & LINQ to XML. I am using XML as database for my current application. I found that I have two options to store & retrieve the values from the Isolated Storage. I can either use the XML Serialization or I can use the simple LINQ to XML. For XML Serialization I am referring to the following link

http://www.codeproject.com/KB/windows-phone-7/wp7rssreader.aspx

For using the simple LINQ to XML I am referring to the following link.

http://rongchaua.net/blog/windows-phone-7-simple-database-example/

In my current application I simply want to add & retrieve the values from the XML file as database. There is no external system interface for my current application. My current application does not depends on any other application & No other application is using the data of my application. Can you please tell me whether I should proceed further by referring to the first link or the second link ?. Please tell me which are the main reasons for going through the above described one of the way. If I am doing anything wrong then please guide me. If anyone is having better ideas than the above described two techniques then please share the ideas.

Upvotes: 2

Views: 1313

Answers (1)

Jon Skeet
Jon Skeet

Reputation: 1504122

Personally I'm a big fan of using LINQ to XML for these things:

  • You get complete control, which means you can handle versioning etc however you want
  • You don't need to fiddle around with serialization attributes
  • It's obvious from the code what will happen - there's no magic involved

On the other hand, it does mean writing code, whereas XML serialization's "magic" could be a quicker route if it works straight away.

Upvotes: 5

Related Questions