With an introduction to the "Lite framework based on Silverlight", Silverlight data requests need to be set up with WCF, WebService or WebClient, and intermediate data needs to be serialized and deserialized, or it is not very user-friendly to use LINQ parsing. And cumbersome, based on the lack of a unified and canonical Silverlight development model, the extraction of kernel-type code from five or six of its own, Silverlight-based midsize projects is a streamlined framework for easy invocation, expansion, and distributed deployment.
First, the framework is divided into 5 pieces (interface, service side, business logic layer, data access layer, universal layer), including 15 projects, through the configuration of Web.config, where the remoting server can be removed, into the interface layer direct access to the logic layer.
Refer to this figure below:
Two, the following is the process of data request
1. The interface layer sends request requests through task, and finally calls the HttpRequest request a Httphandle
2.httpHandle will intercept this request and send it to remotingserver processing,
3.server will send the data of this request directly to the business logic layer processing,
4. The business logic layer will deserialize, extract the method name and parameters in the request, and dynamically execute the data-layer corresponding method through Method.invoke (Dalimpl,paras)
5. Load the entity returned by Method.invoke into the Response, Response.tojson () returns the JSON result
6. Return to the interface layer will be deserialized, restore response,response.data as entity that is the data layer returned entity
Refer to this figure below: