RIA 服务的关系数据效率如何?

发布于 2024-09-15 02:47:57 字数 696 浏览 1 评论 0原文

我一直在研究 silverlight 4 的 RIA 服务并考虑使用它。从 ASP 切换到 silverlight 让我对数据驱动应用程序的 silverlight 成熟度产生了一些担忧。

我正在研究关系数据查询。假设我有一个“人”表和一个“车”表。一个人可以关联多辆汽车。现在,如果我使用关系数据进行查询,我必须指定包含要从服务器返回到客户端的附加表。此处显示:

http ://timheuer.com/blog/archive/2010/01/05/master-details-with-ria-services-and-includedresults.aspx

我有点关心效率。如果我这样做,似乎我可能会从汽车表中为每个人行发送多行(因为它是一对多)。但是,我可能只想要汽车的名称,而不想要其他列。一个更复杂的例子,如果有一堆与其他表的关系连接,可能会变得很丑陋。有什么办法可以解决这个问题吗?我没有看到太多关于自定义/复杂类型或 ria 服务如何处理数据库视图的信息。

我的另一个想法是,如果我有自行循环的关系数据,则会锁定查询。例如,如果人员链接到汽车,而汽车链接到其他表,并且该表链接回人员。它似乎可以永远循环?

I have been researching RIA services with silverlight 4 and considering using it. Switching to silverlight from ASP gives me some concerns about the maturity of silverlight for data driven apps.

I was looking at relational data queries. Lets say I have a 'person' table and a 'cars' table. Multiple cars can be associated with a person. Now if I do queries with relational data I have to specify to include the additional tables to be returned to the client from the server. Shown here:

http://timheuer.com/blog/archive/2010/01/05/master-details-with-ria-services-and-includedresults.aspx

I am a little concerned with efficiency. If I do something like this, it appears I am potentially sending multiple rows from the car table for each person row (since its one to many). However, I may only want the name of the car and not other columns. A more complex example with a bunch of relational joins to other tables could get ugly. Is there any way to address this? I don't see much info on custom/complex types or how ria services handles database views.

Another thought of mine is if I have relational data that loops back on itself will that lock up a query. For example if person links to a car and car links to some other table and that table links back to person. It could seemingly loop forever?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暖伴 2024-09-22 02:47:57

通过 RIA 服务传输(或不传输)的数据量完全取决于您。您不需要包含所有子表数据。是的,可以编写非常低效的数据请求,但也可以使它们达到最佳状态。

ER 模型中通常不会出现无限循环。这与在 SQL 中对表运行联接没有什么不同。

如果您确实关心最大效率(一开始不太可能),您可能会在服务器端使用 SQL 存储过程,并使用特定参数来执行这些过程来完成繁重的工作。

我已经使用 Silverlight 3 构建了多个大型系统,现在使用 Silverlight 4,就我个人而言,现在很难再回到 ASP.Net。它更容易开发(一旦你了解了它的怪癖)并且实际上很有趣:)

希望这会有所帮助。

The amount of data transferred (or not) with RIA services is totally up to you. You are not required to include all child table data. Yes, it is possible to write really inefficient data requests, but it is also possible to make them optimal.

Endless loops don't generally occur in ER models. It is no different to running a join on the tables in SQL.

If you are really concerned with maximum efficiency (unlikely at first) you will probably use SQL store procs anyway on the server side and hit those procs with specific parameters to do the grunt work.

I have build several large systems with Silverlight 3 and now working with 4 and personally I will have a hard time going back to ASP.Net now. It is easier to develop in (once you get to know it's quirks) and is actually a lot of fun :)

Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文