Smartclient Learning (III): Best practices for Distributed Smart Client application development

Source: Internet
Author: User

Smartclient (Smart Client) Notes II. I learned the Sixth Lecture: distributed Smart Client Applications.ProgramDevelopment best practices.
The tutorial mainly explains the distributed and implementation methods. remoting, Web Services, and web app. The last two methods are used much more, mainly remoting.
Distributed means that data and programs can be distributed to multiple servers instead of one server, A Theoretical Computation Model Based on the geographically dispersed geographic information data on the network and the database operations affected by it. Distributed Computing is conducive to task allocation and Optimization on the entire computer system. It overcomes the defects that traditional centralized systems will cause resource shortage and response bottlenecks on the central host, it solves the problems of data heterogeneity, data sharing, and complex operations in the network, and is a major improvement in information system technology.

1. Distributed Design 1. distributed applications have many advantages:

A. Clients only need less hardware support to share efficient server hardware.
B. Only a few components are deployed on the client, so it is easy to update applications.
C. Easy to monitor applications and back up data
E. The server provides an additional layer for security
2. distributed design is divided into two types: synchronous and asynchronous

Although Asynchronous is flexible, it is difficult to design, implement, and test, and the synchronization is simple. Because it is based on the traditional programming model, we only focus on Synchronization for the time being.
RPC-based synchronization design: RPC = Remote Procedure Call. The proxy-stub object uses synchronous call. The proxy is located on the client, and the stub is located on the server ....
The main synchronization designs are as follows:

Remoting: fast but too dedicated
Web Service: when data and cross-platform functions are primarily required
Web app: platform-independent Gui

2 remoting

The application calls and waits for the return of dedicated data.. Net needs to be installed on both the client and server at the same time, the most efficient way.
Because of the use of dedicated data formats and custom network protocols, it is more efficient.

1. Implementation:

Class must inherit from marshalbyrefobject so that the object can be kept on the server side-and the client can maintain the object reference.

Server (IIS as the host ):

A. Create an empty web project named calculatorserver
B. Copy calculatorcomponent. dll, add references, and copy to c: \ Inetpub \ wwwroot \ calculatorserver \ bin.
C. edit web. config to map to remote call object...
<Configuration>
<! -- Test: surf to http: // localhost/calculatorserver/calculator. Rem? WSDL -->
<System. runtime. remoting>
<Application>
<Service> <wellknownmode = "singlecall" objecturi = "Calculator. Rem" type = "calculatorcomponent. calculator, calculatorcomponent"/> </service>
</Service>
</Application>
</System. runtime. remoting>
...

Client (initialized and called ):

A. Copy and reference calculatorcomponent. dll so that. Net can automatically build a proxy
B. Add reference system. runtime. remoting
C. Configure remoting once the application starts.
D. Use new to create a remote calculator object

Using SRR = system. runtime. remoting;
...
SRR. remotingconfiguration. registerwellknownclienttype (system. type. GetType ("calculatorcomponent. calculator, calculatorcomponent", "http: // localhost/calculatorserver/calculator. Rem ");
...
Calc = new calculatorcomponent. calculator ();
Sum = Calc. Add (x, y );

2. Summary

A. Single-call, stateless, IIS-host design: simple, scalable, and efficient
B. singlecall and activated (each client has only one object) and Singleton (there is only one object globally)
C. binary message, common TCP/IP Channel
D. Custom processing host
E. Minimize client deployment (interface/system compatibility correction program)
F. You can redesign the class to reduce the number of calls to the server (the client class is designed to be serializable and passed into the server as a parameter to return the required data .)

Web Services (omitted)

The application sends a request and waits for XML data. The client can be any platform-cross-platform! Some ideas are similar to remoting. Apart from using Web architecture and XML for cross-platform implementation!

4. web app (omitted)

The browser requests the page and waits for HTML data. The platform-independent GUI is exactly what we expect...

________________________________________
Q: Does remoting and Web Service both use IIS servers? Are all HTTP protocols passed? The difference is that data transmission is dedicated and common?
A: Web Service uses IIS as a web server to transmit and call data through HTTP. Remoting is not limited to the IIS server. In addition, remoting can transmit data through HTTP and TCP (data transmission is more efficient ).
________________________________________

 

 

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.