The problem we were having was as simple as it is common: Our web application was sluggish and unresponsive and getting more so over time. The root of this issue could be traced back to how our application loaded the drop downs for code tables, some containing tens of thousands of records. The time to build and pass the records from the middle tier to our JavaScript framework on the browser was taking too long. In addition, we had a JavaScript framework that was heavily customized and several major revisions out of date. The effort involved to upgrade was tantamount to a complete rewrite so we decided to seek an alternative.That’s when Isomorphic’s SmartClient 9.1 came into the picture.
Developing with Isomorphic’s SmartClient
SmartClient is a unified front end and middle tier solution that simplifies the paging of data, while providing a cross browser compatibility. It abstracts out the Ajax communication between the browser and the server and also provides a data layer that handles the CRUD (create, read, update, delete) operations to the database right out of the box. As you can see in the examples below, creating a simple grid on the form is easy.
Figure 1 – Code to display a simple ListGrid
Figure 2 – Simple ListGrid example
Of all the features of SmartClient, what really gave us the much needed performance boost was the built in paging that is worked into their grid display object. It loads only a small subset of the overall data initially and then loads the rest on demand as the user scrolls through the grid. This is implemented as a wrapper on each SQL call that filters the number of records returned to the middle tier to 75 rows no matter how many records are in the table. That is done by adding ROW_NUMBER() OVER in each Select and an additional Where clause that only returns rows with those ROW_NUMBER’s in a specific range. So if your users have a habit of hitting a page and only looking at the most recent data which is displayed by default, they may never go past the original 75 records. Now the developer doesn’t have to do a thing to make it happen, which makes loading those thousand record drop downs no longer a problem.
The Benefits and Drawbacks of Using SmartClient
As with every framework, there are pros and cons. Learning the “SmartClient way” of doing things may be a challenge and having a consultant onsite early in the process, as we did, was invaluable. Here are some of pros and cons that I’ve found:
Benefits:
- Documentation: There is lots and lots of documentation. If you download the SmartClient demonstration software from their website, it comes with full API documentation and hundreds of examples. The API is extensive and the documentation is well laid out and easily searched using SmartClient. You can view it here.
- Javascript: SmartClient has Javascript galore. If you like working in Javascript but don’t necessarily like having to write special Ajax calls for IE7, this may be for you. The meat and potatoes of SmartClient can be found in their editable ListGrid control and DynamicForm.
- Java: You can interject your own Java code at the middle tier. So you can intercept, manage, manipulate, validate, and enhance any call to the database.
- Flexibility: You can stick with their framework to make your database updates directly, or you can override them either at the Javascript, datasource, or Java level.
Drawbacks:
- Documentation: Did I mention there’s a lot of it? If you’re fishing for something specific but don’t have a name for it, it may take a while to find that diamond in the rough. I admit I’m a slow learner, so mastery took a while for me.
- Community: While SmartClient does have its own forum and their staff does provide answers there, it’s not as widely supported as some other frameworks. So if you tend to Google for something and then follow the links to StackOverflow for your answer, you’re less likely to get that kind of support.
While we haven’t pushed this web application to production yet, in side by side tests in our development environment the page load times after using SmartClient are demonstrably lower. Additionally,our development is ahead of schedule, despite utilizing fewer developers than originally planned. As you can see, these early indicators show that choosing SmartClient is a win.