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 开发者_StackOverflow中文版business logic that must occur.
When is a good reason to use data services outside of ajax/js?
Please don't site this page 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. It takes away a lot of the plumbing and configuration required to do this with a standard WCF service. The querying feature is another big plus and something that is difficult to get right with standard 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.
- If you want full control over the service contract or the flexibility of exposing the service over any protocol, stick with plain old WCF.
精彩评论