. Net Smart Client (smartclient)

Source: Internet
Author: User
Introduction
As a feature of the microsoft.net platform, the concept of smart client has been proposed. In fact, many of its functions are used in traditional applications. Program It already exists, but the. NET platform supports it at the system and language level, making it easier to develop smart client applications. This article will discuss the functions and features of the smart client from the perspective of the enterprise application system and how to implement it on the. NET platform.

Overview
1. Comparison of the current client application model
The current client application model is roughly divided into two types: C/S (client/server model) and B/S (Browser/Server Model ). Software developers who take the enterprise environment as the object, for the browser-based thin client application model, and the corresponding rich client, it is difficult to replace generations.
Advantages and disadvantages of browser-based applications:
# Easy installation: it can be used on many desktop computers and has nothing to do with the operating platform computed by the client. Most computers have installed browser software by default (some application systems must be based on IE browsers, or Java virtual machines need to be installed, which cannot be ignored currently ).
# Easy deployment and maintenance: you only need to deploy and maintain on the server.
# Must work online: work efficiency is related to network latency.
# The client computer's resources cannot be fully utilized: the user interface can only be presented in a limited HTML language, without the computing and processing capabilities of the client computer. You can only use the print function of the browser to print data, which is not applicable to enterprise report printing.
# Large network transmission volume: because the client cannot store status data, the user interface content and required data must be transmitted between the client and the server.
# Low security. For servers, data can be filtered through firewall software, because all transmitted content is based on the http port. However, it is difficult to encrypt and sign the data to ensure the integrity of the data during transmission. (HTTPS does not seem to Solve the Problem)
# Suitable for e-commerce applications that do not require strict control of the client.
Advantages and disadvantages of rich client applications:
# Working offline: The premise is that local data must be cached, which involves data synchronization with the server.
# Make full use of the resources of the Client Computer: it can provide users with rich interface elements, and can access the local disk and the local application interface (API), and the execution speed is faster.
# Small amount of network transmission: Only data needs to be transmitted between the client and the server.
# High security. You can easily perform encryption and decryption operations on the client and server, and eliminate obstacles to traditional applications such as firewalls and HTTP through Web Services.
# Installation, deployment, and maintenance are complex: there are certain restrictions and requirements on the operating platform and additional software of the client computer.
# Applicable to internal enterprise applications.
Currently, there is also a browser-based thin client application. Provide them to users through technologies and tools such as Microsoft Terminal Server, Citrix system's Independent Computing Architecture, and MetaFrame products. These types of solutions allow users to use the experience of fat clients and manage them through centralized software installation and maintenance, which is very cost-effective for the company. The problem with this mode is that when the application is not connected to the application server, the user cannot use it. The client does not perform real processing, and the processing relies entirely on the application server. This situation may cause server performance problems and consume the CPU cycle of the desktop computer.
In short, compared with rich clients, the browser-based model is a great model for IT system administrators, however, there are many shortcomings for developers and users.
Microsoft. NET Framework will meet the requirements of these three parties. Its intelligent client application model combines the powerful functions and elasticity of rich client models, as well as easy deployment and Stability of browser-based models.
2. Other functions required by Client Applications
For enterprise application systems, client applications serve as the interaction interface between the entire system and users.
Function:
# Security: The security here mainly refers to the application-level security, which is achieved through user permissions and role allocation. For client applications, a logon form or logon page is usually required for user identity authentication. Application Systems with high security requirements may also need to provide reliable security services for applications through the Public Key Infrastructure (PKI), and the client attaches an encrypted signature module.
# Scalability: client applications should have the ability to contain various types of application modules, while continuously adding applications to improve the entire system. Therefore, the client application can be designed as a container, and each application module as a component is dynamically loaded by the container.
# Configurability: because of the differences between user permissions and user preferences, the application components loaded by the client and their presentation formats vary from person to person. The application system needs to pass the user permission range and user personalized configuration information to the client, and the client application will explain and present the corresponding user interface.

Definition
To sum up, we have a general definition of the Smart Client application model: A Scalable desktop application that can integrate different applications with the following features:
# Non-touch deployment: During installation, you only need to download a master program 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.
# Automatic update: you only need to release 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 Application: When you promise to leave the server, you can use local client programs and application components 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, and the configuration information will be saved to the server.
The following uses the. NET platform winforms application as an example to describe the above features.

. NET platform winforms application example

I. System Requirements
1. Client software requirements
Any operating system that supports. NET Framework
. NET Framework with SP1 installed
Internet Explorer 5.0.1 or later
2. server software requirements
Automatically publish and update servers: Microsoft. NET Framework, mdac2.7, and IIS

Ii. Running Mode
Client Applications can run in two ways. Different running modes will directly affect Assembly release and update. The following describes the specific methods:
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 period, the executable program is downloaded to the disk, which is called the Assembly download cache location (in Windows2000, it is: C: \ Documents and Settings \ Administrator \ Local Settings \ Application Data \ assembly ), at the same time, the Assembly itself and other related Assembly referenced by it are also downloaded to the local ie cache (Windows: C: \ Documents 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.
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 ();

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 administration tool. 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.
Another alternative method is to use Code Group, and use the framework Configuration tool to help you improve the security settings of the 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.
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 the program from the server. Otherwise, use the locally cached program directly. Therefore, for the. NET version

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.