1

I have an existing Windows Phone 7.5 app. This app is using local database to store the data on the phone (overview of local db in WP). Because of that, my business models are decorated with attributes to support storage in the SQL tables such as [Column], [Table]...

I'm considering porting this app to Windows 8. I'm wondering what is a good approach to reuse the business models while changing the storage (WinRT does not support SQL database). I'd like to share the source code of the business models between the 2 platforms.

Thanks,,

japf
  • 6,598
  • 3
  • 33
  • 30

2 Answers2

0

I think using SQLite is the recommended approach. See this short tutorial for some info.

Krzysztof Kozielczyk
  • 5,887
  • 37
  • 28
  • Yes SQLite seems the good approach. However, I don't find an easy way to share the same classes with different attributs: those for SQLCE in the WP version, and those for SQLite in the Win8 version... – japf Sep 25 '12 at 19:41
0

I believe the recommended way is to use MVVM pattern.

MSDN: Model-View-ViewModel Design Pattern

Andras Csehi
  • 4,305
  • 1
  • 28
  • 36
  • I agree 100% with the MVVM approach, however for this particular question I'm wondering how to reuse an existing model already tagged for the DB of WP... But it looks like there is no easy way... – japf Sep 26 '12 at 19:48