RIA 服务与 WCF 服务:有何不同 [英] RIA Services versus WCF services: what is a difference

查看:19
本文介绍了RIA 服务与 WCF 服务:有何不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有很多关于如何使用 .NET RIA 服务构建 Silverlight 应用程序的信息,但不清楚 RIA 中 WCF 中没有的独特之处是什么?

以下是围绕这个话题讨论的几个话题:[1][2]

但他们没有给出问题的答案.

抱歉这个愚蠢的问题,但是如果您已经拥有 Silverlight <--> RIA Services 层会给您的应用带来什么?WCF服务<-->业务逻辑<-->实体框架模型 <-->数据库?验证?验证?它对您来说是可靠的资产吗?

目前我唯一看到的是:使用 RIA 服务,您不需要手动托管 WCF 服务,也不需要在客户端(客户端 == Silverlight 应用程序)配置任何引用.

可能我不知道 RIA 服务的一些非常有用的功能?所以你能指点我的好文档吗?

非常感谢.

附言我已经阅读了很多关于差异的不同文章,但无法澄清……所有文章都在讲述"并且不具体.如果您打算给我一个指向其他文章的链接,请您提供一份您看到的好处列表.

解决方案

实际上,您可以在不使用 RIA 服务的情况下使用相同的验证和身份验证.RIA Services 为您提供的是代码生成.它为您创建课程.您只需要放置业务逻辑.我认为 RIA 服务对于快速开发中小型应用非常有用.

另一个区别是它隐藏了对 Web 服务的异步调用.许多人不喜欢异步模型(这是您可以在 Silverlight 中使用的唯一模型),而 RIA 服务会为您处理.

我推荐阅读 Shawn Wildermuth 的这篇文章,他指出了两种方法的优缺点,还包括 ADO.NET 数据服务(我认为现在称为 WCF 数据服务):

http://wildermuth.com/2009/09/29/Choosing_a_Data_for_Silverlight_ayer>

There are a lot of information how to build Silverlight application using .NET RIA services, but it isn't clear what is unique thing in RIA that is absent in WCF?

Here are few topics that are talking around this topic: [1], [2]

But they doesn't give an answer to the question.

Sorry for the stupid question, but what does RIA Services layer bring into your app if you already have Silverlight <--> WCF Service <--> Business Logic <--> Entity Framework Model <--> Database? Authentication? Validation? Is it relly asset for you?

At the moment the only thing I see: with RIA services usage you don't need to host WCF service manually and don't need to configure any references on the client side (clien side == Silverlight application).

Probably I don't know some very useful features of the RIA Services? So could you please point me to the good doc for that?

Many thanks.

P.S. I've read a lot of different articles about differences, but can't clarify it... all articles "tell around" and aren't concrete. If you are going to give me a link to additional article, could you please be so kind and provide a list of benefits that YOU see.

解决方案

Actually, you can use the same validation and authentication without using RIA Services. What RIA Services gives you is code generation. It creates your classes for you. You only need to put the business logic. I think RIA Services is very useful for developing small to mid apps very rapidly.

Another difference is that it hides the asynchronous calls to the web service. Many people don't like the async model (which is the only one you can use in Silverlight) and RIA services handles that for you.

I recommend reading this article from Shawn Wildermuth where he points out the pros and cons from both approaches and also includes ADO.NET data services (which is now called WCF Data Services, I think):

http://wildermuth.com/2009/09/29/Choosing_a_Data_Access_Layer_for_Silverlight_3

这篇关于RIA 服务与 WCF 服务:有何不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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