Smart Client research notes

Source: Internet
Author: User
This article cited a lotArticle, Referenced from Http://www.microsoft.com/china/community/program/originalarticles/TechDoc/smartclient.mspx

Features of Smart Clients:

    • Deployment without contact: only one masterProgramDownload the file to your local computer and run it directly without changing the registry or shared system components. Other application components will be automatically downloaded at the first run.(The client needs to install. NET Framework)
    • Automatic update: you only need to publish the new version of the program to the server. The client automatically discovers the latest version of the program and application components, and automatically downloads and updates the program.
    • Offline use: when the server is detached, local client programs and application components are used for work.
    • Dynamic Loading of application components: application software developers can develop application components based on the public interfaces of enterprise application systems, and then publish application components on the enterprise servers, the client application automatically discovers and loads the application component.
    • Personalized user interface: You can set the client application based on your preferences. The configuration information is saved to the server.

In terms of advantages, it is suitable for scenarios where the advantages of the rich client and the thin client need to be combined, but it also brings some small problems, such as for access to very real-time data, it is not something in the Smart Client category.

Running Mode
Client Applications can run in two ways. Different running modes will directly affect subsequent Assembly release and update. The following is a detailed explanation:
1. Network Operation
. NET Framework installation provides a mechanism to hook Internet Explorer 5.01 and later to listen to the requested. Net assembly. During the request, the executable program is downloaded to the disk, which is called the Assembly download cache location (in Windows2000:

C: \ Documents ents and Settings \ Administrator \ Local Settings \ Application Data \ Assembly)

At the same time, the Assembly itself and other related Assembly referenced by the Assembly are also downloaded to the local ie cache (Windows is:
 
C: \ Documents ents and Settings \ Administrator \ Local Settings \ Temporary Internet Files)

Then, the process named ieexec starts the application in an environment with limited security settings. For example, you can enter an address in the address bar of IE that has been published on the Web server. net executable program (http: // smartclient/myapplication..

Applications running in this way have very limited security settings (Internet permission set). The permissions in this permission set include: security, file dialog box, printing, independent file storage, user interface. The independent storage file allows your application to save some data (C: \ Documents and Settings \ administrator in Windows2000. in a subdirectory of tomato \ Local Settings \ Application Data \ isolatedstorage, the default storage space is 10 MB. io. classes in the isolatedstorage namespace to store data without throwing a security exception.

It can be found that the Assembly download location is fixed ,. when installing the. NET Framework, some new features are added to IE to support Smart Clients. In this sense, Smart Clients are limited to Microsoft's browsers, I don't know what will happen in the "nagarjune? Coming soon.
A 10 m space may be too tight for some applications. Note the default permissions at any time to avoid mistakes during development. "You can use the class in the system. Io. isolatedstorage namespace to save data without throwing a security exception ." As a technical solution, you should pay attention to it at any time.

Example:
// Obtain an independent storage zone by user, domain, or assembly
Isolatedstoragefile isostore = isolatedstoragefile. getstore (isolatedstorag.pdf. User | isolatedstorag.pdf. domain | isolatedstorag.pdf. Assembly, null, null );
// Create a directory
Isostore. createdirectory ("testdir ");
// Create a file
Isolatedstoragefilestream isostream1 = new isolatedstoragefilestream ("testdir // test.txt", filemode. Create, isostore );
// Write a file
Streamwriter writer = NULL;
Writer = new streamwriter (isostream1 );
Writer. writeline ("Hello isolated storage ");
Writer. Close ();
Isostream1.close ();

There is nothing to say.CodeAnd you can remember to add it each time.

To make your smart application run, you need to change the security settings of some clients. In essence, it is to notify the client to trust your application during running time. One way is to add the site with your assembly to the list of trusted sites in IE, and then use Microsoft installed in the directory of your management tools. net Framework Configuration tool to modify.. NET Framework security settings. Open the framework Configuration tool, select the Runtime library security policy, and then select to adjust the security zone. For all sites specified in a trusted site, the trust level is adjusted to full trust. You can also use the framework configuaration tool to modify the security policy so that it trusts the individual assembly of your application. Right-click the running database security policy and choose to increase the trust level of the Assembly.

This will cause unnecessary troubles. Do you need to manually set each machine of the customer? There should be ways to directly adjust the security settings,. the program compiled by net does not know whether it has such permissions. If it has such permissions, it will also bring about unnecessary problems. This is not very clear, and it does not know whether there is a solution.

Another alternative method is to use code groups and framework configuration tools to help you improve the security settings of application system assembly. You need to make this change for all desktop users who use your application. To help complete this task, the Framework Configuration tool can create a Microsoft Installer (MSI) Deployment package containing security policies. MSI has installed the Application Loader to distribute the security policies and Loader Assembly required by your application. Right-click the running database security policy and choose create deployment package.

Oh, myGod, as mentioned here, you can solve the problem by using the framework Configuration tool to create a deployment package ,. net Applications on Smart Clients are well considered.

During network running, automatic updates are implemented by the cache mechanism of IE. That is, when you need to download and run an application, ie will send an HTTP request to the Web server, which will get the latest update date of the Program on the server, if the date is later than the date of the locally cached program or the program does not exist in the local cache, download it from the server. Otherwise, directly use the locally cached program. Therefore,. the version mechanism of. Net itself cannot be used as the basis for version update. Only when an assembly file references another assembly can the. NET. net is used to determine the version number based on its version mechanism.

Based on the time, does the time of the server and client need to be unified? Is there any impact if it is different? What is the mechanism for updating the date? Is it based on the Creation Time of the program or what? Considering that the client software is a file downloaded from the server at runtime, this may not be affected. However, when the time is serious, are there any unpredictable factors?

Note:

    • When loading an application component, a complete URL is required.
    •  In this mode, you usually need to set your security policy before running.
    • If a web service needs to be called in an application set, the server address of the web service can only be the server where the Assembly was originally downloaded. You can construct a redirection to solve this problem.
    • Some files may not be updated automatically, such as the configuration file of the. config application.
    • If the versions of some application assembly files have some associations, in some cases (such as sudden network interruptions) The client application may fail to load correctly and cause errors.
    • If you clear the IE cache, the client application cannot work offline.

Note that these issues are important. For example, if the configuration file of the. config application is not updated automatically due to restrictions on Web service calls, if there is a version association between the Assembly, there is also a sudden interruption of the network, resulting in the impact. They are all very common and difficult problems in practical applications. Here we only put forward the precautions and did not provide solutions for such problems. It seems that further exploration is required.

2. Run locally
As the name suggests, this running method does not cache client applications and other application components in IE. net download cache to run, you need to first download the client assembly and save it to a local directory, and then run. In this way, client applications and other application components have all local security permissions.

This seems to be a good idea, but what is the difference between it and C/S? Continue reading ..........

Although security issues are not involved, how does one implement automatic updates of application components and programs? This requires a separate component to complete these tasks. With this link, you can download a well-developed and scalable automatic update component (http://www.gotdotnet.com/team/windowsforms/DotNetUpdater.zip) that provides source code, examples, and documentation. The update component uses HTTP-DAV technology to transfer files between the server and the client, so there are some limitations on the Web server, iis5.0 and the new version of Apache support this feature. For more information, see the documentation.

This component can run on IIS and Apache. Does Apache also support Asp.net? Oh, I have never noticed it before. Hahaha ............
Dotnetupdater.zip looks like a good thing. It will be described by "a very comprehensive and scalable automatic update component". It is not an advertisement and can be used on IIS and Apache, can meet a lot of needs.

Note:

    • Because you need to update and download the function on your own, it will increase the workload. (Third-party update components must also be improved to meet their own requirements)

It was an advertisement, and it fainted ~~~~~~~~~~~. Just now, I just said, "a very well-developed and scalable automatic update component." in a twinkling of an eye, I should pay attention to the fact that third-party components also need to be improved to meet their own requirements, it is estimated that this term is too heavy to exceed the description of "auto update components that are very comprehensive and support expansion.

    • It basically solves the disadvantages of network operation, but needs to re-download all files each time when updating (if incremental updates are used, some versions of files may be omitted in some cases ), will increase network traffic.

"If incremental updates are used, some versions of files may be missing in some cases." And even more dizzy, isn't it humorous? If so, what is the use of incremental update? In which cases, omissions may occur and are not clearly understood.

    • Update and download should be performed in the background thread, without affecting users' normal operations.

Oh, my God, I used my own intelligence? In terms of development, there are so many concerns. Is this also called direct support? Is it also a perfect support?
I am thinking about the advantages of the. NET platform for Smart Client development compared to the direct development of non-. net?

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.