Click here to monitor SSC
  • Av rating:
  • Total votes: 35
  • Total comments: 4
Steve Joubert

Smart client architecture

05 November 2005

Data solutions for disconnected applications

"Smart client" is more than a fancy moniker for Win Forms, or a marketing ploy to sell Visual Studio 2005. It is an architecture that allows Win Forms applications to function when they are disconnected from the network and their primary data source.

Smart client is not a new concept. Back in 1996, during my PowerBuilder days, I remember the Sybase team pushing disconnected Windows applications. Today it is an idea whose time has come.

Smart client design considerations

A smart client application can run on a network database or a local data store running on the same machine as the application. The application should function the same in either mode. That means all necessary data must be cached locally and a synchronization method must be available to update the primary database when the application is connected again. When deciding on a client-side data store, there are several considerations.

Licensing could be an issue if you are building a commercial software product, in that the cost of the license must be factored into the sale price of the product. An unlimited distribution license may be available, but can be expensive. In the corporations for which I’ve worked, this kind of per-seat expense could only be justified for departments such as sales and finance.

If your application is commercial software, ease of installation will be a primary consideration. You’ll need a way to install the product on any supported operating system, and it must co-exist with software typically found on a user’s workstation.

If you’re developing a corporate application, workstations may be free from games and poorly written screen savors, but your solution must still function within certain desktop standards. Your solution might also need to be certified by the people constructing your installation images.

Whether commercial or corporate, sometimes software fails and the database/data store is to blame. So consider how much knowledge there is within the group that will support the product, as well as the level of support available from the vendor. Does the vendor have open support? Is a contract required? Is the fee structure per incident or per hour? What hours and/or days is tech support available? Remember that you could be sitting at your desk on New Year’s Eve because a member of the board of directors has a database problem and you can’t leave until it’s fixed.

Security is another concern. There are two threats to your application’s data when it is sitting on a client’s laptop. One comes from hackers attempting to obtain data from the data store. This is a very real threat and has been heightened by corporate espionage. The second is the unsecured laptop itself. Why try to hack a corporation’s firewalls and security if its sales figures walk out the door each night on someone’s laptop? At home that laptop is likely connected to the Internet via an unsecured, high-speed connection, and its data is there for the taking.

A security concern that is largely unintentional but corrupts data just the same is user tampering. Some people can’t help digging around on their computers, trying to determine how things work. They find your Access database and, with their Access software, start prodding through the tables or text files. It won’t take much to corrupt your data.

Finally, consider the volume of the data and the scale of the system. If you have 50 or 60 data elements and only a few hundred rows need to be cached per element, then you’ve got an open hand to look at different solutions. If you need to cache hundreds of thousands of rows of data, you will need a high-performance data store to keep your application running in a disconnected state.

Technologies to employ

Below are options to consider for building smart client applications.

MSDE

– The Microsoft Data Engine is the often-forgotten stepchild of SQL Server 2000. It’s a solid technology but lacks the admin and authoring tools of the standard SQL Server 2000 installation. It can also be cumbersome to install correctly on a client machine. Because it’s free, there are no licensing concerns, and it supports high-volume data applications. Unfortunately, it’s easy for a hacker to find and get at the data.

SQL Server 2005 Express

– This new version of MSDE is much improved. While it also lacks many of the capabilities of the full SQL Server package, the Express edition is not totally impoverished when it comes to management and authoring tools. When it is released, it will be good for high-volume apps, but will probably be an easy target for hackers as well.

SQL Anywhere

– This is a product from Sybase. I mentioned earlier that I first heard about smart client in 1996. Sybase was pushing the concept, and SQL Anywhere was the product behind it. Like SQL Server 2005 Express, this is a robust database. It offers a tremendous number of features, including full data encryption. It is, however, one of the pricier options available.

Access

– The price is right, and you don’t necessarily need Access to create an Access database, although it helps. You are likely to have someone on your team with a strong Access background as well. Scalability is limited, however, so Access should not be considered for a high-volume data application. You can password-protect the file, but the meddle factor is high. If security is a concern, remember that your data is packaged in a self-contained file that’s easy for a hacker to download.

Vista DB

– Vista DB 2.0 is a .NET database that deploys with your application as a set of DLLs. It supports the SQL-92 standard and provides a complete set of data access components that mirror the ones Microsoft provides for SQL Server and Oracle. This is a robust database solution capable of handling moderate data loads. It requires no installation beyond simple x-copy. The license allows for free unlimited distribution. While not a free solution, it is cost-effective and feature-rich.

XML

– Because you have to write this solution yourself, it is the most time consuming. You can store your application data in XML form in flat files on the client machine. You have granular control over how the data is stored, and once you load the document in an XML Document object, you can use xPath queries to get at your data. Unless you encrypt your XML data files, they will also be subject to hacking and meddling.

Datasets

– This is another XML option, but it has some advantages over writing the solution from scratch. It’s easy to move data from your connected network data store to the client: Simply populate the dataset and have it save the XML on the client machine. When you disconnect, create a dataset and have it open the XML file. From there you can simulate SQL functionality using dataviews to filter and sort data. Datasets maintain the state of data for you, so when you are connected again it’s easy to load the dataset with the changed data and send it to the main data store.

Conclusion

Building a smart client application is a lot of work. It also has many implications, so it should only be considered when an application must be able to function offline. To be successful in creating this type of application, understand that the devil is in the implementation details.

Steve Joubert

Author profile:

Steve Joubert is a Microsoft Certified Professional in developing web applications in C#. He has spent nine years developing Microsoft technologies, including building .NET applications, and has a background in such diverse markets as pharmaceuticals, biotech, banking, finance and entertainment. He currently works for ASPSOFT in Orlando, Fla.

Search for other articles by Steve Joubert

Rate this article:   Avg rating: from a total of 35 votes.


Poor

OK

Good

Great

Must read
Have Your Say
Do you have an opinion on this article? Then add your comment below:
You must be logged in to post to this forum

Click here to log in.


Subject: Help me to change content in page
Posted by: Anonymous (not signed in)
Posted on: Monday, December 25, 2006 at 2:05 AM
Message: I have a problem when I click linkbutton in asp.net to desplay hello work in the same page but in my page have alot of image background. I want a hello work desplay in the same page in the label but don't want image background to refresh. please help me and send result to phiseyit@yahoo.com

Subject: Smart Client Offline Application Block
Posted by: Anonymous (not signed in)
Posted on: Thursday, January 18, 2007 at 5:39 AM
Message: Hi,
Smart Client Offline Application Block is not for .net 1.1 but I want to make smart client project in .net 2.0 VS 2005. is it possible to do? if yes then could you please send me any link from where i can come to know how to create Smart client project in VS 2005.

Regards,
Rupesh kumar Tiwri
Mumbai


Subject: Anonymous comments disabled
Posted by: AnnaL (view profile)
Posted on: Monday, September 03, 2007 at 5:21 AM
Message: We've had to disable anonymous comments on this article due to relentless spamming.

To post a comment please sign in, or register if you are not already a member.

Subject: winform application with oracle database deployment.
Posted by: priyadharshani (view profile)
Posted on: Friday, May 23, 2008 at 4:15 AM
Message: can winform application with oracle database be deployed using smart client deployment?
I develped an winform application with oracle database,i want to deploy this application.I added setup project to the application and deployed.The deployed application works well in my machine but when i install in the client maschine it throughs error
"System.Data.OracleClient requires Oracle client software version 8.1.7 or greater." i heared that for deploying .net with oracle db ,oracle client has to be installed in the xlient machine using my application.But if i need my application to be installed in 100 machine,it is little complex.
can this problem be solved using "smart client deployment"?

Thanks in advance.

 

Top Rated

Acceptance Testing with FitNesse: Multiplicities and Comparisons
 FitNesse is one of the most popular tools for unit testing since it is designed with a Wiki-style... Read more...

Acceptance Testing with FitNesse: Symbols, Variables and Code-behind Styles
 Although FitNesse can be used as a generic automated testing tool for both applications and databases,... Read more...

Acceptance Testing with FitNesse: Documentation and Infrastructure
 FitNesse is a popular general-purpose wiki-based framework for writing acceptance tests for software... Read more...

TortoiseSVN and Subversion Cookbook Part 11: Subversion and Oracle
 It is only recently that the tools have existed to make source-control easy for database developers.... Read more...

TortoiseSVN and Subversion Cookbook Part 10: Extending the reach of Subversion
 Subversion provides a good way of source-controlling a database, but many operations are best done from... Read more...

Most Viewed

A Complete URL Rewriting Solution for ASP.NET 2.0
 Ever wondered whether it's possible to create neater URLS, free of bulky Query String parameters?... Read more...

Visual Studio Setup - projects and custom actions
 This article describes the kinds of custom actions that can be used in your Visual Studio setup project. Read more...

.NET Application Architecture: the Data Access Layer
 Find out how to design a robust data access layer for your .NET applications. Read more...

Calling Cross Domain Web Services in AJAX
 The latest craze for mashups involves making cross-domain calls to Web Services from APIs made publicly... Read more...

Web Parts in ASP.NET 2.0
 Most Web Parts implementations allow users to create a single portal page where they can personalize... Read more...

Why Join

Over 400,000 Microsoft professionals subscribe to the Simple-Talk technical journal. Join today, it's fast, simple, free and secure.