Windows Phone 7数据持久性 [英] Windows Phone 7 Data Persistence

查看:66
本文介绍了Windows Phone 7数据持久性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望获得有关最佳数据持久性解决方案的一些建议,以将其用于将在桌面(WPF)和Windows Phone 7上运行的应用程序,并在两个应用程序之间共享数据.理想情况下,我想使用实体框架.我考虑了以下技术:

I'm would like some advice on the best data persistence solution to use for an application that will run on the desktop (WPF) and on Windows Phone 7, sharing data between both applications. Ideally I would like to use the Entity Framework. I have considered the following technologies:

  1. Sync Framework 4.0-目前仅CTP,但具有脱机使用的巨大优势.但是,它是一个不成熟的框架,不允许我使用实体框架,而且似乎不是非常主流,需要相当多的学习曲线才能开始工作.
  2. WCF数据服务-具有允许我使用实体框架的优点.但是,在检索数据时似乎有点滞后,并且离线使用是个问题.
  3. 具有使用Sync Framework 2.1同步到中央托管数据库的SQL CE-适用于我的WPF应用程序,但不确定手机.

有太多可用的技术,很难看到树林中的树木".我想尽可能保持主流,以使其更容易获得帮助和查找代码示例等.我欢迎任何建议或指导.

There are so many technologies available it is difficult to "see the forest for the trees". I'd like to stay fairly mainstream if possible just to make it easier with getting help and finding code samples etc. I'm open to any suggestions or guidance.

推荐答案

不幸的是,电话不支持SQL CE,因此您需要使用

Unfortunately, SQL CE is not currenlty supported on the phone so you'll need to use one of the other available databases there.

尽管它只是CTP格式,但我还是建议您看一下Sync Framework.如果您对同步的要求不高,那么您应该真正避免自己编写同步服务来重新发明轮子.

Although it's only in a CTP format I'd recommend giving Sync Framework a look. It your synchronization requirements are anything but trivial you should really avoid reinventing the wheel by writing the synchronisation service yourself.

即使您确实使用了Sync Framework,我也不明白为什么这会阻止您在桌面上使用Entity Framework.

Even if you did use the Sync Framework, I don't understand why that would stop you using Entity Framework on the desktop.

AFAIK WP7目前没有ORM,因此您必须在此创建自己的DAL.

AFAIK there are currently no ORMs for the WP7 so you'll have to create your own DAL there.

这篇关于Windows Phone 7数据持久性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆