Intelligence at the interface

This article was originally published in VSJ, which is now part of Developer Fusion.
It could well be that the time has come for the Smart Client idea. I say “idea” because it isn’t really a single technique or technology. You can be using .NET and not producing Smart Clients. It really is more that a Smart Client is a set of characteristics that an application deserving the appellation should possess. There is no hard and fast definition of what these characteristics are, but the list includes at least the defining set of:
  • The application should utilise local resources
  • It should be “connected” in the widest possible sense and make use of these remote resources as needed
  • Although connectivity should play a big role in its usability, the application should function when off line
  • It should have intelligent and flexible install and update
  • If it makes sense for the application then it should also work on a range of client devices – smart phones and so on
Notice that a Smart Client is not a thin client, in that it can use substantial local resources, but it isn’t a fat client either, because it doesn’t try to do everything itself. For complex or specialised tasks it shifts to using a server rather than trying to do the job locally.

Why does Visual Studio 2005 make it easier to create Smart Clients? The answer is because it makes it easy to utilise remote or local resources. The availability of general networking, web, web service, SOAP, and XML classes and components makes it so easy to build connectivity into applications that there is no need to contemplate the cost/benefit of adding this to the application. If you want to connect to a web service, or structure the application as a client-server, or use a more general SOA (Service Oriented Architecture), then you can. New classes allow you to make secure encrypted connections, use older protocols such as FTP, work with email and even implement a web server in the client.

Of course all of this is in addition to the Windows and Web Forms class libraries, which make it possible to build rich client user interfaces without excessive effort or the need for extreme computing power. The good news is that the Compact Framework allows applications to be developed for Smart devices running Windows CE. You can use Visual Basic or C# in the same development environment used to build Windows or Web applications. The Compact Framework is also substantially the same as the full .NET Framework, with the addition of classes that are only useful in a mobile device such as telephony and messaging services. Developers also have the option of using native C++ and the ATL, MFC or native Windows CE APIs. You can also mix managed and unmanaged code in any of the languages. It is easy to target multiple platforms with the same source code, and there is a new emulator that makes initial testing easy.

Building Office into your application doesn’t automatically make it a Smart Client, but it does give you a head start in that direction. Using the functionality in a local resource as powerful as Office means you can produce sophisticated applications with little effort. The Visual Studio Tool for Office (VSTO) allows you to develop Office applications within the Visual Studio environment using all of the facilities of the .NET framework. Excel and Word documents open in Visual Studio, and you can create office projects including Outlook add-ins using the templates provided. You can place .NET controls on the documents and write code behind. The combination of office and the connectivity facilities offered by .NET makes Smart Clients even smarter.

Finally, how easy it for a user to install and maintain a .NET Smart Client? The new ClickOnce deployment system makes it possible to create applications that can be installed and run as easily as web applications. You can deploy your full Windows application to a web server, network share or media such as CD/DVD. It can be run by the user in an online mode, or it can be permanently installed. Even if permanently installed, a ClickOnce application is completely self-contained, so cannot interfere with existing applications, and doesn’t depend on local configuration. It is also relatively easy to implement self-updating. Applications can check for newer versions and perform an upgrade. Upgrades can also be easily rolled back, partly because of the self- contained nature of a ClickOnce application. Naturally, all of this works in a secure fashion. Each ClickOnce application is installed and run from a secure per-user cache, and run by default in Internet or Intranet security zones. If necessary the application can request more security permissions.

Visual Studio 2005 provides all the tools needed to create Smart Clients, but it is up to you to decide how to use them creatively. It is certainly true that we have to think differently about exactly what an application is and what an increasingly demanding audience expects from us. Our applications have to be smart online and offline, run on a range of devices, and look after themselves by installing smart and upgrading when necessary.


Dr Mike James, editor of VSJ, has over 20 years of programming experience, both as a developer and lecturer. He has written numerous books and articles on programming and his PhD is in computer science.

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“If debugging is the process of removing software bugs, then programming must be the process of putting them in.” - Edsger Dijkstra