Data Strategies in Windows Mobile

I am developing a C # application on Windows Mobile, and like most of my WM applications, I always tie in when I decide on a serialization strategy. In the desktop world, I'm not too worried about this because I've already developed a pretty robust XML XML serializer, but in the WM world, I don't want to use it due to reflection performance penalties.

So I am developing everything related to data access interfaces (DAOs), so I can easily replace various implementations for serialization in xml, registry, sqlce, etc. During development, I usually do non-stationary, memory DAOs (using the <> dictionary) first, followed by the XmlSerializer DAO when I want to save the data, and then when done, move on to a full blown DAO for SQL.

However, in my last application, I cannot use the DAO XmlSerializer due to how poorly it (does not) handle properties that are interfaces. IE, I have a Foo object that contains a List <IBar> Bars property, the XmlSerializer cannot serialize it (although I could easily develop my own custom XML serializer that could follow the shape).

Anything to ask this question: What DAO strategies have you found to help you develop WM applications? Are you planning ahead for several different DAOs at different levels of application maturity? Are you starting with a full blown DAO? What would you recommend for a fast and convenient persistent DIA when the XmlSerializer cannot be used?

+1


source to share


1 answer


Well, that doesn't necessarily apply in your case (since it XmlSerializer

wants specific types , for example ), but protobuf-net is a binary serialization mechanism that works in all .NET flavors, including CF 2.0 and CF 3.5; this will allow you to store data and exchange it with your full full 3.5 server (or indeed java, perl, php, etc ).



It's definitely fast and easy, so it's definitely worth seeing if you want to transfer data to WM.

+1


source







All Articles