简体   繁体   English

RIA服务与WCF服务:有什么区别

[英]RIA Services versus WCF services: what is a difference

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? 有很多关于如何使用.NET RIA服务构建Silverlight应用程序的信息,但目前尚不清楚RCF中WCF中缺少什么是唯一的东西?

Here are few topics that are talking around this topic: [1] , [2] 以下是围绕这一主题的几个主题: [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 ? 抱歉这个愚蠢的问题,但如果您已经拥有Silverlight <--> WCF Service <--> Business Logic <--> Entity Framework Model <--> Database ,那么RIA Services层会为您的应用带来什么? 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). 目前我唯一看到的是:使用RIA服务时,您不需要手动托管WCF服务,也不需要在客户端配置任何引用(clien side == Silverlight应用程序)。

Probably I don't know some very useful features of the RIA Services? 可能我不知道RIA服务的一些非常有用的功能? So could you please point me to the good doc for that? 所以,请你指点那个好医生吗?

Many thanks. 非常感谢。

PS I've read a lot of different articles about differences, but can't clarify it... all articles "tell around" and aren't concrete. PS我已经阅读了很多关于差异的不同文章,但无法澄清它......所有文章都“讲述”并且不具体。 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. 实际上,您可以使用相同的验证和身份验证,而无需使用RIA服务。 What RIA Services gives you is code generation. RIA Services为您提供的是代码生成。 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. 我认为RIA Services对于快速开发中小型应用程序非常有用。

Another difference is that it hides the asynchronous calls to the web service. 另一个区别是它隐藏了对Web服务的异步调用。 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. 许多人不喜欢异步模型(这是您可以在Silverlight中使用的唯一模型),RIA服务会为您处理。

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): 我建议阅读Shawn Wildermuth的这篇文章,他指出了这两种方法的优点和缺点,还包括ADO.NET数据服务(现在我称之为WCF数据服务):

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

Well, I wouldn't agree with the previous posted answer. 好吧,我不同意之前发布的答案。 WCF Ria Sercices is a great architecture and times have shown proves. WCF Ria Sercices是一个伟大的建筑,时代已证明。 I would rather take a look at http://blogs.msdn.com/b/saurabh/archive/2009/11/23/understanding-the-wcf-in-wcf-ria-services.aspx 我宁愿看看http://blogs.msdn.com/b/saurabh/archive/2009/11/23/understanding-the-wcf-in-wcf-ria-services.aspx

Actually I use WCF Ria Services on a large LOB application targeting 1500+ contemporary users. 实际上,我在针对1500多名当代用户的大型LOB应用程序上使用WCF Ria Services。 I'have done massive use of client code generation customization (see the Varun's blog for details) but I'm able to use LINQ over the wire with silverlight and I have the possibility to choose between automatic lazy or eager loading among the enitities on the context. 我已经大量使用客户端代码生成定制(请参阅Varun的博客了解详细信息),但我可以使用带有Silverlight的线路上的LINQ,我可以在自动延迟或急切加载之间进行选择。上下文。 And please don't forget that the rest paradigm of WCF Ria Services also permits the use of OutputCache. 请不要忘记,WCF Ria Services的其余范例也允许使用OutputCache。

Not the mention that thanks to custom metadataprovider you can greatly facilitate the generation of the client and how the data are serialized to the client. 没有提到,由于自定义metadataprovider,您可以极大地方便客户端的生成以及如何将数据序列化到客户端。 I believe that if your Silverlight application is Context based you can surely go with WCF Ria Services. 我相信如果您的Silverlight应用程序是基于上下文的,那么您肯定可以使用WCF Ria Services。 Hope this helps, Marco 希望这有帮助,马可

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM