WCF Data Services/ RIA Services概念

WCF Data Services

WCF Data Services (or Data Services for short) is another data-centric communication technology built on the WCF stack that exposes data to clients as JSON- or ATOM-serialized RESTful resources using the OData protocol. The OData protocol specifies how a client can query, navigate, and update data exposed by a service. Using this protocol, the client can communicate with the service in a RESTful manner by retrieving data using a standard HTTP GET call (using specially constructed URIs), and sending updates to the server using a standard HTTP POST call.

WCF Data Services是服务以REST的形式发布是非常的简单,相比WCF服务

  1. 查询方面:由于引入了查询表达式,因此对于查询条件动态变化的情况非常的方便【由于是动态执行,当然相比存储过程来说性能会有一定的损失,如果性能问题突出的话,同样可以使用Service Operations或则WCF Service进行处理】
  2. 由于基于REST,因此服务和其他的集成更方便

Data Services vs. RIA Services

Data Services shares a number of similarities with RIA Services, and in a way you could consider the two to be sibling technologies, at times both jostling for attention and attempting to outdo each other. Both are built on top of WCF and conform to a pattern to expose data to clients, but each has a somewhat different focus. RIA Services (at least for the time being) specifically targets Silverlight clients, whereas Data Services is client agnostic. While RIA Services generates code in the client project in order for the client to communicate with the services (an aspect that concerns some developers who are against “magic” code generation that they have no control over), Data Services does not need a link to the client project, and no code generation is required. Instead, Data Services provides a client library (discussed shortly) to help the client interact with the service.

It can be difficult to identify whether you should use RIA Services or Data Services in your project, and how the two differ. However, you can break it down to the following:

•  RIA Services has a rich model designed for the development of end-to-end Silverlight applications (with the server tightly linked with its client via the code generation process). 

•  Data Services is designed simply to expose data as RESTful resources in a standalone manner that a range of clients can consume (such as reporting tools that can consume data exposed over HTTP and serialized as either ATOM or JSON).  That said, RIA Services can also expose data as RESTful resources that can be consumed by a range of clients (by enabling OData or exposing a JSON endpoint using the functionality provided in the WCF RIA Services Toolkit). Also, together with its ability to share code and validation logic with the client (among the numerous other features it provides), you will find it the best solution when writing an end-to-end Silverlight application. However, if you want your service to support a wide variety of clients without having a tight relationship to your Silverlight project, Data Services is a viable alternative.

时间: 2024-09-17 22:05:27

WCF Data Services/ RIA Services概念的相关文章

更强悍的Silverlight: WCF RIA Services

如果你安装了 VS 2010 的 Silverlight 4 开发工具,会发现一项重量级的安装项目,WCF RIA Services,用于Silverlight数据访问服务,比WCF和ADO.NET Data Service和Web服务都要简单. 在一个三层架构的应用程序中,中间层介于表示层和数据层之间,你所写的业务逻辑和数据验证都将在中间层出现.创建拥有良好用户体验的RIA应用,你需要客户端和服务端有着相同的业务规则,因此在客户端和服务端保证同步的中间层变得至关重要.WCF RIA Servi

WCF RIA Services 客户端、服务端的处理方法和例子

Silverlight客户端访问 1. 首先Project Link到服务端项目,Build服务端项目是在客户端项目的Generated_Code和其他一些目录下会生成相关的代码 2. 使用代码或XAML(DomainDataSource )访问服务 xmlns:domain="clr-namespace:RIA.Web.Services"Title="Demo Page" Style="{StaticResource PageStyle}" x

Consuming Hidden WCF RIA Services

 原文 http://codeseekah.com/2013/07/05/consuming-hidden-wcf-ria-services/ A Silverlight application made it to my desk yesterday, an application that consumed a remote WCF RIA service running on a Microsoft IIS. The service did not provide a public API

WCF Data Services实例:ASP.net AJAX访问

本文参考 Code.msdn的例子,在此基础上实现了一个参考例子,代码放在了: http://dskit.codeplex.com 如果想在Asp.net MVC应用以JavaScript中访问WCF Data Service服务,以下是使用Microsoft AJAX Library库进行处理的例子 var dataContext; var queryObject, queryObject1; Sys.require([Sys.components.dataView, Sys.componen

WCF Data Services查询

上一篇文章http://www.cnblogs.com/2018/archive/2010/10/15/1852579.html介绍了WCF Data Service的基础知识,下面介绍一下查询 查询在WCF Data Services十分的方便,更强的功能在这些类别中可以看到WCF Data Service的超级威力.可以直接在浏览器中输入查询表达式等进行访问 直接使用例子可从http://dskit.codeplex.com下载 查询表达式Query Expressions 一般的查询表达式

艾伟:Microsoft .NET RIA Services快速上手

在MIX 09上,Nikhil Kothari发布了微软的一神作--Microsoft .NET RIA Services.虽然目前的版本仅仅是可怜的"March '09 Preview",但它已经足够让人兴奋不已.简单地说,在这之前,如果你用到了现在的RIA技术比如Silverlight,你只能选择写大量的服务或者WCF来实现数据的操作功能:而有了.NET RIA Services,你在RIA项目上操作数据,就像ASP.NET那样方便! Nikhil Kothari在MIX09上介绍

Microsoft .NET RIA Services快速上手

在MIX 09上,Nikhil Kothari发布了微软的一神作--Microsoft .NET RIA Services.虽然目前的版本仅仅是可怜的"March '09 Preview",但它已经足够让人兴奋不已.简单地说,在这之前,如果你用到了现在的RIA技术比如Silverlight,你只能选择写大量的服务或者WCF来实现数据的操作功能:而有了.NET RIA Services,你在RIA项目上操作数据,就像ASP.NET那样方便! Nikhil Kothari在MIX09上介绍

WCF Data Service使用总结 (一)了解OData协议

最近做了一个小项目,其中用到了 WCF Data Service,之前是叫 ADO.NET Data Service 的.关于WCF Data Service,博客园里的介绍并不多,但它确实是个很好的框架.可以很方便地通HTTP来访问数据库,如果你是做富客户端开发的,用它绝对能大大减少你的工作量.出于对这个框架的喜爱,于是把自己的一些使用经验写下来,并且希望有更多的人能够用上. OData简介 说起 WCF Data Service ,不得不说的是 OData.对于一个标准的 Web 服务,它往

WCF Data Service与net.tcp承载分析

今天WCF Data Service部署在支持net.tcp的IIS站点上时会出现问题,通过分析和查找相关资料有了一些结论. http://www.rajneeshnoonia.com/blog/2009/12/ria-wcf-configuration-finally-resolved/ 这个是在VS2008下的早期版本正常,新的VS2010不可用 默认的绑定和查看 框架默认支持的绑定在web.config设置了 <serviceHostingEnvironment aspNetCompati