简体   繁体   English

我应该何时选择使用WCF与WCF数据服务

[英]When should i choose to use WCF versus WCF Data Services

Assume a situation where a data will never be queried directly. 假设永远不会直接查询数据的情况。 AKA, there will always be some filtering logic and/or business logic that must occur. AKA,总会有一些必须发生的过滤逻辑和/或业务逻辑。

When is a good reason to use data services outside of ajax/js? 何时在ajax / js之外使用数据服务是一个很好的理由?

Please don't site this page http://msdn.microsoft.com/en-us/data/bb931106.aspx 请不要站点此页面http://msdn.microsoft.com/en-us/data/bb931106.aspx

Your essentially asking what layer of abstraction should I use, WCF Data Services is built on top of WCF and aims to simplify the process of creating a REST based service that is consumable by anything on the web. 您基本上是在询问我应该使用哪个抽象层,WCF数据服务是建立在WCF之上的,旨在简化创建基于REST的服务的过程,该服务可由Web上的任何内容使用。 It takes away a lot of the plumbing and configuration required to do this with a standard WCF service. 它通过标准WCF服务消除了执行此操作所需的大量管道和配置。 The querying feature is another big plus and something that is difficult to get right with standard WCF. 查询功能是另一大优点,而且很难通过标准WCF实现。

So in short: 简而言之:

  • If you want to quickly build a loosely typed service that wraps an existing data model and enables querying support give WCF Data Services a go. 如果您想快速构建一个松散类型的服务,该服务包装现有数据模型并启用查询支持,则可以使用WCF数据服务。
  • If you want full control over the service contract or the flexibility of exposing the service over any protocol, stick with plain old WCF. 如果您想要完全控制服务合同或通过任何协议公开服务的灵活性,请坚持使用普通的旧WCF。

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

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