January 29, 2011

WCF Ria Services vs WCF Services

WCF RIA Services

Pro’s:
  • Service can be consumed easily from Silverlight, AJAX, and WebForms. (Not winforms(??))
  • Non-discoverable.
  • Richer client side object model by including business rules and relationships between objects.
  • Quicker to set up. Good for Rapid development.
  • More control over what is exposed. Uses a set Interface.
  • Integrated change tracking by default.
  • Can monitor changes in client and batch the changes to the server.
  • Uses reflection at design time to see objects (doesn’t use service contracts)
  • Creates client code in Silverlight.
  • Design time experience with data sources, drag drop etc. (Contains these features)
  • Shares validation logic in client.
  • Can use a set interface. Also provides Context object in client.
  • Can support Linq queries between client and server but these are based on Interface.
  • Examples:
    • GetGamesByIdQuery(1);
    • Var qry = GetGamesQuery().Where(g =>; g.Price < 50)
      LoadOperation op = cnt.Load(qry);
Con’s:
  • Harder to Customize than WCF Services
  • No message-level security
  • Serialization is not well supported (has limitations)
  • Gives up flexibility compared to WCF
  • Harder to debug.
  • Not easy to integrate with large enterprise applications
  • More tightly coupled than WCF Services.

WCF Services

Pro’s:
  • Standardized on OData protocol
  • Loosely coupled clients and servers
  • Service can be consumed from .NET, Silverlight, AJAX, PHP and Java (libraries available).
  • Cross platform interoperability as a goal: Out-of-box support from future MS products such as SQL2008 R2, Azure, Excel 2010, SharePoint 2010, etc.
  • RESTful
  • Discoverable
  • Uses JSON and ATOM (xml-based feed format)
  • Can interact WCF service using standard HTTP verbs such as GET/POST/DELETE
  • Uses Entity data modeling (EDM), entity-relationship derivative
  • Non-relational sources can be represented using EDM exposed as data service.
  • Support for Membership => activate membership endpoint.
  • Allows you to add operations to fill custom operations.
  • Includes Data Context class to monitor changes, issue changes in batches with transactional support.
  • Queryable end-points (not a set interface).
  • Flexible querying, paging association traversal.
  • Supports Linq queries between client and server. Client can create Linq query and run it on server.
    • Example:
      var qry from g in ds.Games WHERE Id == 1
      select g
      Qry.BeginExecute();
  • Code written on client is small (Linq calls and context class work)
 Con’s:
  • Does not give tight control over Interface to data access

No comments:

Post a Comment