More powerful Silverlight: WCF Ria services

Source: Internet
Author: User

If you have installed the Silverlight 4 development tool of vs 2010, you will find a heavyweight installation project, WCF Ria services, used for Silverlight data access services, such as WCF and ADO. NET data service and Web Service must be simple.

Applications in a three-tier architectureProgramThe middle layer is between the presentation layer and the data layer, and the business logic and data verification you write will all appear in the middle layer. To create an RIA application with good user experience, you must have the same business rules between the client and the server. Therefore, it is crucial to ensure the synchronization of the intermediate layer between the client and the server. The following describes how to use domain services to shareCodeAnd data entities to create the middle layer.
The domainservice class is the base class of all server domain services classes. In addition, WCF Ria Services provides two abstract classes inherited from domainservice: linqtoentitiesdomainservice and linqtosqldomainservice.

The main reason why the WCF Ria service is so important to Silverlight is that Silverlight is a client-executed environment and cannot be like ASP.. net, and communicate directly with the back-end data source. Data Storage, reading, and storage must all span the network. We must use the n-tier architecture to allow Silverlight to smoothly access remote data, this is a good practice. At the technical level, developers can abide by the best practices of modern software development, but it is not a simple task for small projects, microsoft's consistent style is to provide developers with a silly development model. WCF Ria services enables the entire Silverlight platform to have the same level of database application development capabilities as web form or win form.

The WCF Ria service makes the process of developing a multi-layer architecture look like a traditional 2-layer architecture application. Because of the import of the WCF Ria service, the 4th version of Silverlight is sufficient to become a major milestone in the development of related technologies, and this is what we skip Silverlight 2 and Silverlight 3, one of the most important reasons to wait for Silverlight 4 to come.

In Silverlight 3, we use WCF or ADO. NET data service is a service developed completely to solve this problem. It is also based on the WCF Service, and supports various communication protocols, currently, the WCF Ria service only uses HTTP binding and Silverlight 4 supports TCP binding. For details, refer to high-speed communication in infoq Silverlight 4. For enterprise business systems, I will select TCP binding. Of course, this is only a beta version. Later versions will definitely change. WCF Ria services not only supports Silverlight, but will also support asp.net/ajaxand so on in the future.

We know that WCF uses endpoint (address, binding, and contract) and can be configured through configuration files and programming. By default, WCF Ria service uses its own servicehost, called domainservicehost, domainservicehost is programmed with three endpoints for the rest interface: webhttpbinding, basichttpbinding, and binaryhttpbinding. All bindings are configured with maxcompute edmessagesize of "2147483647 ". The three binding types of the default address are as follows:

Bind Address Description
Webhttpbinding Baseaddress Rest with JSON endpoint
Basichttpbinding Baseaddress "+"/soap" Soap with XML endpoint
Binaryhttpbinding Baseaddress "+"/binary" Soap with binary endpoint

Based on the high flexibility of WCF, you can customize the domainservicehost to modify the relevant configuration to meet your needs. If these are done by Microsoft, they will be more influential. It is expected that the WCF Ria service can inherit the flexibility of WCF to provide us with powerful solutions.

If you are interested in the WCF Ria service, refer to the following resources:

  • WCF Ria Services Code Gallery
  • WCF Ria services
  • Building N-tier business applications with. Net Ria services-Part I
  • Building N-tier business applications with WCF Ria services-Part II
  • WCF net. TCP protocol in Silverlight 4
  • Http://weblogs.asp.net/fredriknormen/default.aspx
  • Understanding the WCF in 'wcf Ria services
  • Silverlight 4 WCF Ria services lob application hands-on Lab

  • Using WCF Ria services with your poco, Part 1: Creating a WCF Ria service library
    Using WCF Ria services with your poco, Part 2: creating a simple domain service
    Using WCF Ria services with your poco, Part 3: calling the domain service form a Silverlight Client
    Using WCF Ria services with your poco, Part 4: returning a simple poco from Ria
    Using WCF Ria services with your poco, Part 5: returning a poco in another assembly from the domain service
  • Http://blogs.msdn.com/brada/archive/2010/03/16/silverlight-4-ria-services-ready-for-business-updating-data-in-the-client.aspx

        Contact Us

        The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

        If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

        A Free Trial That Lets You Build Big!

        Start building with 50+ products and up to 12 months usage for Elastic Compute Service

        • Sales Support

          1 on 1 presale consultation

        • After-Sales Support

          24/7 Technical Support 6 Free Tickets per Quarter Faster Response

        • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.