Introduction
For the past five years, software developers targeting the corporate environment have faced a difficult tradeoff when deciding between the browser-based, thin client application model and its rich client counterpart.
The browser-based application is easy to install and maintain, can target many desktops, and has no impact on the state of the client computer. Yet in spite of these advantages, the browser-based model is far from perfect. Rich client applications provide a richer user interface (UI) along with access to the local disk and local application programming interfaces (APIs), further empowering the developer and resulting in a more productive user experience. Because they run locally on the client computer, rich client applications also make For More Efficient User to Work Offline.
Overall, relative to the rich client, the browser-based model is wonderful for information technology (IT) administrators, but leaves much to be desired for both developers and end users. The Microsoft .NET Framework programming model serves the interests of all three parties ................................
This paper provides an overview of the .NET Framework smart client application model, explaining how it works from a high-level perspective, and elaborating on how this architecture compares with the browser-based model.
No more DLL VERSION Conflicts
Dynamic-link libraries (DLLs) built using the .NET Framework are not subject to versioning conflicts. In the past, these common problems were the bane of the systems administrator's existence. They occurred during installation when a new application replaced a shared DLL in the system registry with a different version that was incompatible with some of the other local applications referencing it, effectively breaking them.By default, applications built using the .NET Framework are self-contained and isolated, resolving assemblies (the .NET version of components) from the local application directory rather than from a global or shared location. With this approach, multiple versions of the same assembly can coexist on the same system without conflict. Furthermore, there is no need to "register" any of the assemblies used in an Application. this process is referred to as xcopy deployment. with xcopy deployment, to install an application on a class, simply copy the application directivity To the appropriate location on the target machine's Local Disk, And It's Ready to Go. To Uninstall, Simply delete The Application Directory.
It remains possible to share assemblies, using a central repository known as the global assembly cache. Each assembly registered here is assigned a strong internal name, derived from its file name, version, culture (such as English, German, and Japanese), digital signature, and public key. Thus, each shared assembly is uniquely identifiable. This allows multiple versions of a given assembly to coexist in the global assembly cache and even run concurrently without conflict, a scenario known as side-by-side execution.
By default, applications bind to the strong name of the shared component that they were built against. Of course, if an administrator ever wishes to change this policy, perhaps in the case of a hot fix, he or she may do so by writing a SIMPLE PUBLISHER Policy Configuration File or by Using The .NET Framework Configuration Tool, Which Ships with the .net framework.top of page
Deploying Smart Client Assemblies from A Web Server
The assembly resolution model summarized above addresses application stability, predictability, and ease of installation-essentially what happens when the application arrives at the client computer. But how do you get the application to the client computer in the first place?
. As before, smart client applications can be delivered by CD, DVD, floppy disk, or via application deployment infrastructure such as Microsoft Systems Management Server The .NET Framework introduces yet another option: No-Touch Deployment, deploying the application from a remote Web Server Using The Hypertext Transfer Protocol (HTTP).
Essentially, this process mirrors the browser-based application deployment approach. Using methods provided in the .NET Framework class libraries, an application can be written to download the assemblies it needs dynamically from a remote Web server. The first time a particular assembly is referenced , it is downloaded to the assembly download cache on the client computer and loaded for use. Going forward, if the assembly required is already on the client computer and the version on the Web server has not changed, the local copy will be loaded. If the version on the Web server has been updated, that new version will be downloaded and executed. Thus, updates are automatically propagated to the client, but the network is not flooded with redundant downloads.Note that assemblies are downloaded dynamically, only as they are Reference Dows Applications To Load Quickly-No 50-MB, Half-Hour Installation Process Just To Get Started.
IMPLEMENTING NO-TOUCH Deployment
Currently, You CAN IMPLEMENT No-Touch Deployment in Three Different Ways. Each Is Outlined Below:
URL Launched Executable: Put your executable out on a remote Web server, and let the user navigate to it by entering the URL in Microsoft Internet Explorer or by clicking on a hyperlink to that URL (for example, http: // RemoteWebServer / myExe. exe). The executable will be downloaded to the assembly download cache on the client machine and launched from that location. DLLs required by the executable can be referenced as normal in your code. Unless informed otherwise (see # 2 below), the common language runtime (CLR) will look for the DLLs in the same directory on the remote Web server as the executable, and the CLR will download them into the assembly download cache from there, as needed.The downside to this approach is that the user does not find an icon with which to launch the application, but must navigate to the destination URL or click on a link in an HTML page every time. Again, if the version on the Web server has not changed, the .NET Framework will launch the version Of the executa ble stored in the assembly download cache Technically, the experience is sound From a usability perspective, however, this process leaves something to be desired Use the Assembly.LoadFrom method from the System.Reflection class...:
This is helpful in two scenarios. In the first, the initial executable was launched via a URL (see # 1 above), but now needs to access DLLs that are located in a different directory on the server or on a different Web server altogether. in the second, more common scenario, the application is architected so that there is a small, lightweight executable installed on the client machine. This executable need not contain much in the way of core logic. Ideally, it just references the DLLs it needs, which reside out on a remote Web server and which supply all of the necessary application logic. Having the executable installed on the client machine in this way means that the user will have an icon with which to launch the application. Again, installing the executable could Be as easy as copying it ONTO YOUR'S LOCAL Disk-No Registration Required. The code Samples Below Give Guidance On How To Use assembly.loadFrom: in C #:
AskEMBLY DownloadedAssembly;
Type formType;
Form DownloadedmedForm;
Try
{
// Download and Load the assembly
DownloadedAssembly =
AskMBLY.LOADFROM ("http:// [remotewebserver] /csharpform2.dll");
// Find the Type in the assembly for the object we want to create
FormType = DownloadEDassembly.gettype ("csharpform2.form2);
// Create An Instance of the Desired Type and Show IT
DownloadedmedForm = (form) system.activator.createInstance (formtype);
IF (DownloadedformedForm! = NULL)
{
Downloadedformed form.show ();
}
}
Catch (Exception EXC)
{
Messagebox.show (exc.tostring ());
}
Use the .NET Application Updater component: This is a handy piece of sample code written by one of the .NET Framework program managers at Microsoft It is quite simple to use, and provides native support for offline access and gives the developer more flexibility in. terms of when the Web server is polled to check for updates to the assemblies stored there for more information on this component, visit the .NET Application Updater Component page on GotDotNet.Code Access Security:. Making No-Touch Deployment Safe
For system administrators and users to feel safe about downloading and running applications from a remote Web server, there must be a security system in place that protects client computers from activating a virus or other harmful code. To prevent security breaches from happening, the .NET Framework supports a powerful, fine-grained, evidence-based security system, enabling code to be trusted to varying degrees, depending upon its origin and other characteristics such as its digital signature or the identity of the author. For example, code loaded from an intranet Web server will not be allowed to access the client computer's Registry or file system or gain network access to any other server on the network besides the one from which it originated. Meanwhile, code bearing a particular digital signature or Authenticode signature might be granted significantly More Permissions, Such as The Ability To Read from, But Not Write to Reval Disk, The Ability To Revise Some Environment Variab les, the ability to interact with three of the seven available databases on the network, and so on. The .NET Framework ships with default security settings that are safe and appropriate for most situations. Systems administrators can use the .NET Framework Configuration Tool or A Scriptable Command Line Tool To Modify There Settings As Desired.
At run time, the .NET Framework execution environment, the common language runtime (CLR), performs low-level security checks with a technology known as code access security. This technology ensures that code executes only those operations allowed by the security policies it has been assigned. in doing so, the CLR checks not only the permissions allotted to the assembly attempting a particular operation, but also those of all the other assemblies in the stack that might be calling the active assembly to act on their behalf. only operations approved in this comprehensive stack walk will be performed.If software developers are concerned that their applications will not run properly without a certain minimum set of security permissions, they can specify their requirements in advance with attributes included in the assembly's metadata. If these permissions are not Grand, The assembly will not be loading.
This security architecture ensures that unauthorized code can not access or otherwise abuse the local system in any way, and gives IT administrators more granular control over the applications running on their systems.
Smart Client Versus Browser-Based Application
With these smart client technologies, it's easy to see how the platform-specific application model reflects a practical approach to software development. But how does it compare with the browser-based model? Consider the following.
Work offline
One obvious but critical advantage that smart client applications have over browser-based applications is the capability to work offline. Practical Internet access is anything but ubiquitous. According to IDC, at the end of 2002, approximately 38.9 percent of US households engaged in some form of home-office activity.¹ At that time, according to The Yankee Group, only 16 percent of those households were expected to have any form of high-speed connectivity to the Internet.² This means that, assuming a remote worker has access to the Internet (not a given for those traveling and seeking to work from hotels, airports, or airplanes), chances are he or she will be forced to endure an irritatingly slow dial-up connection every time an attempt is made to access or manipulate data using a browser-based application. Even if high-speed access is available, what happens when the server goes down? With smart client applications, these problems can be avoided. Once the necessary assemblies are do Wnlined to the Local Disk, The User Can Work Productively Offline.harness The Full Power of Available Resources Efficintly and Safely
Web-based applications are often architected so that all processing is handled by the servers. The advantage of placing the entire burden on the server is that it makes it easier to push an application to multiple different types of clients. The disadvantage is that, for Even The SimpleSt Request, The Client-Side User Must Endure Both Network Latency and The Amount of Time It Taketes The Server To Queue Up The Given Request and Process IT.
Performing some or all of the work locally with smart client applications means quicker response time and reduced network and server workload, making for more scalable infrastructure. A smart client application can run without any interaction with the network and the server, completely freeing up that infrastructure , or it can go to the server as needed to dynamically download an assembly or to invoke an Extensible Markup Language (XML) Web service. The fact that even some of the work will be done locallyâ € "loading and implementing the UI controls, for EXAMPLE '"RESULTS IN A More Dynamic User Experience and Much More Efficient Use of the Infrastructure Available, Both Client and Networked.
Web-based applications can be architected to offload some of the processing to the client using scripting or Microsoft ActiveX® controls, but both have limitations when compared with the smart client application model. By default, Web-based script essentially runs in a "sandbox "and is prevented from accessing local resources. Scripted applications can not read from or write to a client user's local disks, so all data must be stored on a remote server. Again, this causes problems when the user is faced with a slow Internet connection or wishes to work offline. Scripted applications are also unable interact with applications housed on the client computer, such as a Microsoft Excel or the Microsoft Outlook® messaging and collaboration client (as explained in the next section). They can certainly offload some of the work From The Server, But The Local Computer. Furthermore, They Are I edibly difficult and expensive to develop well. Dynamic Hypertext Markup Language (DHTML) applications can replicate some of the look and feel of a Microsoft Windows®-based application.However, while many tools are available for creating basic HTML UI, good tool support for building rich, dynamic DHTML is virtually nonexistent. The UI must be coded by hand. With smart client applications, a developer can simply drag and drop controls onto a form in Microsoft Visual Studio® .NET, and most of the code is generated automatically.
ActiveX controls overcome this barrier, to some degree. They can be developed in integrated development environment (IDE) tools and they enable a Web-based application to access local system resources, but their security architecture is not up to par with that of smart client applications. Users must decide whether or not to run the control. Once the control is activated, there is no way to limit the access it has to the local computer.Smart client applications built on the .NET Framework have the best of all possible worlds . The Windows Forms libraries enable quick and easy Windows-style UI development that can be implemented either by hand-coding or by dragging and dropping controls onto a form in Visual Studio .NET. Smart client applications can access the local system but only in so Much as They isy...................
Again, it is no longer an all-or-nothing security decision but a fine-grained determination that can permit some operations but forbid others. Finally, the burden of this decision is taken off the user and handled transparently by CLR, using either the Default security settings or those configured by the system administrator.
Access Local Apis
Smart client applications can leverage powerful Windows-based APIs that are unavailable to non-ActiveX browser-based applications. For example, smart client applications can utilize the graphical power of the GDI libraries. Smart client applications can tie into the Microsoft Office APIs, enabling developers to manipulate Microsoft Word, Microsoft Access, Excel, Outlook, and Microsoft PowerPoint® through their own applications. Smart client applications also have the ability to listen for incoming network requests, thus enabling peer-to-peer connectivity. This example, in particular Deserves a section all its ing.use peer-to-peer technology
In a peer-to-peer scenario, a computer can act as both client and server, making requests of other peer computers and responding to requests placed on it by these peers. According to the Gartner Group, peer-to-peer technologies "will allow users to spontaneously communicate, exchange data, [and] cooperatively run application programs. "³ One example of this is a file-sharing system, in which an application running on one computer can search for and retrieve a desired file from a peer computer while making its own files available in reciprocation. Another example is an application running on one computer that can seek out those computers on the network with spare processor power and disk space and harness these unused resources for its own use, enabling a corporation to more fully Leverage the infrastructure available to it.
Peer-to-peer technology represents a powerful paradigm with tremendous promise, but it can only be implemented using smart client applications. Web browsers, being user-driven by design, do not have the necessary capacity to listen for and respond to spontaneous requests made By Other Clients on The Network.consume Web Services
Just like browser-based applications, with just a few lines of code, .NET Framework smart client applications can consume functionality provided by Web services. Web services provide a model for distributed computing based on standard, platform-neutral protocols such as SOAP, XML And http. Web Services Enable Applications To Interact Regardless of What Underlying Platforms The May BE Running On and provides a perfect way to integrate new application with legacy code.
Consume A Web Service
In Visual Studio .NET, go to the Solution Explorer, right-click on References and select Add Web Reference. Enter the URL where the Web service of choice is located. (In the sample code below, we'll use an imaginary calculator Web .. service) Then, select Add Reference Steps 1 and 2 will create a local proxy of the Web service that you can program against as though it were a DLL residing on your development machine Note:. The code below works whether you are building a Smart Client Application Or A Microsoft ASP.NET Browser-based Application.
IN C #:
Try
{
// Instantiate THE XML Web Service
CalcWebservice1.calculator Calc = New CalcWebService1.calculator ();
// Get the value from 2 TextBoxes on your form and enter them Into
// the add method of the xml web service
INT Value1 = Convert.Toint32 (TextBox1.text);
INT Value2 = Convert.Toint32 (TextBox2.text);
Int result = cagc.add (value1, value2); // convert the result to a string and display it in the label on
// Your Form
String Tempstring = Convert.toString (Result);
Label1.text = tempstring;
}
Catch (Exception EXC)
{
Messagebox.show (exc.tostring ());
}
PROVEN SUCCESS
Already, a wide range of software development shops, from corporate IT departments to independent software vendors (ISVs) to professional service firms, have embraced the .NET Framework smart client model as the appropriate architectural solution for their development needs.
At Credit Suisse First Boston (CSFB), a leading global investment banking firm, developers working in the Securities Division are creating smart client applications that will be deployed from Web servers and will allow fixed-income securities traders to enter and view the status of their trades. "Smart client technology enables us to vastly reduce the cost of deploying applications and vastly simplifies the support requirements of those applications," says CSFB Vice President Andrew K. Smith, who runs CSFB's London-based Coretech group. "It also allows us to combine the ease of deployment of HTML pages with the rich client experience we're accustomed to from Visual Basic interfaces. "Smith estimates that deploying desktop applications from Web servers in this manner will save the bank millions of dollars in IT expenses.
Intuitive Manufacturing Systems (IMS), an ISV that provides enterprise resource planning software to small and medium-sized manufacturing companies around the world, chose the smart client model over a browser-based architecture for the next release of its best-selling IntuitiveERP software. No-Touch Deployment from a Web server, coupled with the prospects of a richer UI and the leveraging the processing power and memory of the client computer, made IMS 'choice an easy one.Immedient, a business and technology consulting firm with offices throughout the United States, recently ported a billed accounts receivable tracking application to the .NET Framework for the General Services Administration, one of its clients. The firm originally considered using a browser-based architecture but found that Windows Forms coupled with No-Touch Deployment from a Web Server Offered A Richer And More InTuitive Interface, Better Performance, And The Flexibility To Run Offline, While Providing All The Depl Oyment and maintenance benefits of browser-based applations.
Conclusion: Where and when to import smart clients
The smart client architecture is not ideal for every scenario. In situations such as e-commerce, where user platforms are unknown or diverse, the browser-based model continues to represent the most practical approach. However, in the context of a corporate computing environment , where clients are known to be running the Windows operating system, the smart client model is the architecture of choice, combining the power and flexibility of rich client applications with the stability and ease of deployment associated with browser-based applications.
Bamboo
"Residential Broadband: Is DSL Conceding THE HIGH-SPEED Access Race?" (The Yankee Group, May 31, 2002) 2
"U.S. HOME Office Forecast and Analysis, 1999-2004" by Mary Porter and ray Boggs (International Data Corporation, June 2000)
3
"Seeking New Investment Opportunities: The next paradigm" by R. Batchelder, S. Hayward, And A. Roussel (Gartner Group, September 2001)