SmartGWT 1.0: A Q&A with Sanjiv Jivan

Earlier this month, SmartGWT 1.0 was released. SmartGWT is an API for building GWT applications using the SmartClient Javascript component library. SmartGWT was developed by Sanjiv Jivan, the same developer who previously lead gwt-ext development, and subsequently ceased his involvement due to licensing issues.

InfoQ had a chance to discuss SmartGWT with Sanjiv Jivan and get his perspective on the new project, comparisons to gwt-ext, and the plans for the project.

What are the main features that SmartGWT supports?

SmartGWT makes the complete APIs of the SmartClient AJAX RIA platform available in GWT. SmartClient is very different from other Ajax libraries in that it provides not only a very complete widget set, but also handles the hard problems involved in building enterprise applications: not just loading and displaying data, but propagating user changes back to the server, and handling all of the consequences of those changes - server validation and other error handling, cache updates across multiple components, etc.

SmartGWT's data-aware widgets - such as Tree, Grid, Calendar and several others - provide complete end-to-end user interactions like tree reordering, dragging events in a Calendar, which automatically generate appropriate server requests to update data with a simple protocol that's easy to customize. This subject is key in understanding the true value SmartGWT provides and a more detailed introduction can be found here.

A few other features worth mentioning:

  • SmartGWT supports live grids that not only lazy load rows from the server on demand, but also lazily render columns as the user scrolls horizontally. Most browsers can't handle rendering a large number of columns in tables and the lazy rendering capabilities of SmartGWT grids makes displaying large tables a breeze without a performance hit. The TreeGrid which supports multiple columns, editing, lazy loading of nodes, and virtual scrolling is also very powerful and something that many applications require.
  • Adaptive sorting and filtering in grids is pretty neat feature. When the data is filtered down to a number that fits in the local buffer, additional filters applied by the user no longer results in roundtrip calls to the server and data from the local buffer is used. It transparently reverts back to making calls to the server when the the data required to fulfill the request is not in the local buffer. This makes a huge difference in the real-world responsiveness and performance of enterprise apps, by cutting down on trips to the database and giving users instant responses instead
  • Relogin: For applications requiring authentication, if a request is made and the session has timed out, SmartGWT makes it easy to implement a workflow where the user is prompted to relogin and on being authenticated successfully the original transaction is resumed without loss of data or context

What is the primary difference between gwt-ext and SmartGWT?

Besides the obvious difference in the actual functionality provided by each underlying library, in gwt-ext, there a is a fair amount of glue code to "fix" inconsistent API's and funky rendering behavior in ExtJS. In working with SmartClient, everything pretty much worked right away. The widget component hierarchy is consistent and object oriented so a direct translation to SmartGWT worked out real well.

SmartGWT also uses the standard GWT 1.6 event API which is much cleaner and flexible compared to its predecessor. As a result users no longer have to deal with listener adapter classes.

Another important difference is that SmartGWT has the full support of SmartClient where users can make feature requests, expedite bug fixes, get support and training and not worry about hitting a roadblock. Additionally, users have the benefit of a commercial friendly LGPL licensed library. Its the best of both worlds.

Having worked with both ExtJS and SmartClient, how do the two component frameworks compare?

ExtJS is certainly feature rich and looks sharp. It was the reason that I started gwt-ext a while ago when Ext was LGPL. However when working on GWT-Ext, there were a lot of corner cases, gotchas, deferred rendering workarounds and inconsistent class hierarchies in Ext where glue code had to be added to "fix" some of these inconsistencies. For example some layouts allow you to dynamically add new components while a couple of key layouts don't support it. Also another key issue is that a good percentage of widget properties cannot be changed after the widget has been rendered, and in some cases users need to set a property and sometimes they need to call a method to accomplish the same thing.

SmartClient has been developed over the past 8 years and it is extremely stable and virtually bug free. The component model is consistent and it is highly dynamic allowing users to change most properties post-render with the changes reflected immediately. It has significantly more functionality and handles server integration really well. If you browse the SmartClient forums, a few things become quickly apparent:

  1. You almost never hear that "this feature is not available / supported". Pretty much everything that users request is available.
  2. The number of bugs reported in next to zero.
  3. You don't find any unanswered questions.

Another thing that you'll notice if you view the source of the samples in their Showcase is that so much can be done with so little code. A master-detail screen that also sends updates to the server can be written with as few as 10 lines of code when passed a reusable DataSource definition.

Do you have any comments for users on SmartGWT being a wrapper over SmartClient versus being a complete rewrite?

A common misconception that users have is that any third-party library written in GWT magically runs fast, is completely leak free, and renders perfectly on all browsers. As an example a TableGrid written by a third party in GWT from scratch could still perform really poorly, and not display consistently on all browsers. There are obviously several aspects to GWT that helps avoid leaks and such but this does not mean that any third party code written in GWT is 100% leak free. What actually matters is that the framework code is well written and carefully tuned and well tested.

The reality is that SmartClient is fast and stable and provides an excellent base for SmartGWT. In fact, in my experience, SmartClient actually does a better job of solving browser inconsistencies than pure GWT third party libraries. SmartClient offers an accurate and consistent cross-browser layout with an object-oriented skinning system that doesn't require deep CSS expertise or knowledge of browser quirks.

In May you blogged about your decision to step down from the gwt-ext project due to the controversial licensing changes with ExtJS. How has that decision been received by the community?

The community has been very understanding and the other team leaders of gwt-ext have also stepped up and done a great job. Most importantly the community that really grown and its great to see users helping other users.

I've had conversations with the gwt-ext team leads and they have expressed that having an option for users that feel limited with gwt-ext to migrate to SmartGWT is a healthy option. Assistance will be provided to users who are interested in migrating. Ofcourse the gwt-ext project will continue to run the way it currently is.

The evolution of SmartGWT to version 1.0 has been very quick, even assuming you started development in May. Were there lessons you learned in developing gwt-ext that you were able to apply to SmartGWT?

Working on an open source project is mostly about personal satisfaction and the "feel good" aspect of being involved in a project that is of use to several other users. It is also a great learning experience that helps personal development.

On the technical side of things, I was able to apply my learnings during the development of gwt-ext towards SmartGWT while improving upon the common issues faced by the users. I also learned it was very important to pick a project that doesn't involve politics and something that is motivating.

It was extremely distressing to frequently receive emails from the owners of Ext, LLC threating to sue me if I didn't play along with their plans. For instance they wanted me to switch to GPL or else they would find me in violation of their license. Again, no details were provided. I also received another threat where they said that I would hear from their lawyers within 24 hours if I didn't allow them to post on the gwt-ext forum. And this was after I put in a lot of effort building a project which directly supported growth and sales of their own library.

In contrast, the folks at SmartClient have been fully supportive of SmartGWT, providing technical assistance and a safe home for SmartGWT which will be operated under their umbrella. They even wrote a public letter indicating that they will not switch licenses of their LGPL offering. It feels great to be back working on technical stuff with what I consider a superior product.


The top 10 challenges for India

By 2050, India can be 40 times bigger than it is now, but it needs to overcome some tough challenges. If it can implement certain changes, it has the potential to be larger than the United States by 2050, says a global research report by Goldman Sachs on 'Ten Things for India to Achieve its 2050 Potential.'

The report, brought out by Jim O'Neill, head global research at Goldman Sachs, and Tushar Poddar, vice president, research, Asia Economic Research Team, Goldman Sachs India, outlines 10 crucial steps that India must take in order to achieve its full potential.

If India can undertake the necessary reforms, it can raise its growth potential by as much as 2.8 per cent per annum, says the report.

Find out what the 10 key areas where reform is needed are.

1. Improve governance

Without better governance, delivery systems and effective implementation, India will find it difficult to educate its citizens, build its infrastructure, increase agricultural productivity and ensure that the fruits of economic growth are well established.

2. Raise educational achievement

Among more micro factors, raising India's educational achievement is a major requirement to help achieve the nation's potential. According to our basic indicators, a vast number of India's young people receive no (or only the most basic) education. A major effort to boost basic education is needed. A number of initiatives, such as a continued expansion of Pratham and the introduction of Teach First, for example, should be pursued.

3. Increase quality and quantity of universities

At the other end of the spectrum, India should also have a more defined plan to raise the number and the quality of top universities.

4. Control inflation

Although India has not suffered particularly from dramatic inflation, it is currently experiencing a rise in inflation similar to that seen in a number of emerging economies. Thea authors of the report think that a formal adoption of inflation targetting would be a very sensible move to help India persuade its huge population of the (permanent) benefits of price stability.

5. Introduce a credible fiscal policy

6. Liberalise financial markets

To improve further the macro variables within the GES framework, the report believes that further liberalisation of Indian financial markets is necessary.

7. Increase trade with neighbours

In terms of international trade, India continues to be much less 'open' than many of its other large emerging nation colleagues, especially China. Given the significant number of nations with large populations on its borders, the Goldman Sachs report recommends that India target a major increase in trade with China, Pakistan and Bangladesh.

8. Increase agricultural productivity

9. Improve infrastructure

Focus on infrastructure in India is legendary, and tales of woe abound. Improvements are taking place, as any foreign business visitor will be aware, but the need for more is paramount. Without such improvement, development will be limited.

10. Improve environmental quality

The final area where greater reforms are needed is the environment. Achieving greater energy efficiencies and boosting the cleanliness of energy and water usage would increase the likelihood of a sustainable stronger growth path for India.

The Goldman Sachs report adds that not all these 'action areas' can be addressed at the same time, but in coming years progress will have to be made in all of them if India is to achieve its very exciting growth potential.


Using GWT-Ext in Eclipse

Using Eclipse to develop your GWT-Ext code helps you utilize the built-in tooling available with the IDE and access the myriad plugins which Java developers swear by. Together with Cypal Studios' GWT plugin for Eclipse, developing GWT-Ext applications is a breeze. Let's get started with designing a simple page with a static titled panel and some inner text. This simple tutorial explores the configuration of your project and simple but useful features of Eclipse.

Using GWT-Ext you can develop Rich Internet Application like the one seen below

GWT-Ext 2.0 Showcase

How to install Netbeans in Ubuntu

I'm used to use Netbeans 6.1m but find it quite lacking compare to Eclipse. After that, I settled with Eclipse for quite some time. Just last week, I happen to bump into Netbeans website and see Roumen's Ruby Flash Demos: Ruby on Rails in NetBeans (Part One)
Advanced Ruby editing features in NetBeans (Part Two).

After seeing the flash demos, I said, "Wow! Netbeans has improved tremendously. " So I decided to install it. Below is the steps:

1. Go to http://wiki.netbeans.org/wiki/view/MilestoneDownloads
2. Download Binaries and sources
3. Choose Netbeans version: 6.0 and Build Type: Daily, click continue
4. Choose the latest build, usually the one on the top (the product type is IDE)
5. Then download the linux installer (around ~45MB)
6. When the download completed, make the installer executable
chmod +x netbeans-6_0-daily-bin-200703151900-linux-15_Mar_2007_1900.bin
7. Then execute the installer by typing
./netbeans-6_0-daily-bin-200703151900-linux-15_Mar_2007_1900.bin
8. A graphical installer will appear, just follow the steps in the installer. It's damn easy that I can click cleck all the way to the end.
9. After installation completed, you'll find Netbeans under Application | Programming | Netbeans 6.0 Dev
10. Run it. When it fully loaded. Choose Tool menu and then Update Center.

11. Choose "Check the Web for available Updates and New Modules" and then click Next.
12. After it complete download the latest update available, choose Ruby on Rails Project support under "Available Updates and New Modules".

12. Click add button to include module that you've chosen. After you satisfied with the selection, click next to initate the installation. Get a cup of coffee while the downloading and installing happen.

13. After download completed, choose next and then choose finish. A dialog box will ask you whether to restart IDE and continue working. Choose restart IDE.
14. When the IDE restarted, choose the File | New Project, look for Ruby. If your installation is OK, you'll get the options as in below pic:


15. The installation has been successful. Do view the two flash demos I mentioned earlier to know further how to develop the Ruby and Rails applications under Netbeans.

Update (19th March 2007):
The easiest way to install Ruby and Rails is to choose Ruby under the Features module. It'll installed both Ruby and Ruby on Rails and all the dependencies.

##Known problem:
1. Netbeans not yet fully support running Rails outside JRuby as mentioned by Tor Norbye in his blog
2. There is no way to run 'script/console' yet.

10 steps to a prettier, more useful and secure USB pen drive

USB thumb drives are one of the most commonly used ways to transfer data if you happen to work across multiple computers. Lets just make the USB drives prettier, useful and secure.

1. Add icons and labels to your drive.

usb driveDownload an icon you would want to see appear when you plug in your thumb(pen) drive. Place the icon at the root of the drive. Next open notepad and type the following:

[autorun]

label = ""

icon = "yourIcon.ico"

Save the file onto the root of your thumb drive and name it "autorun.inf", be sure to put the quotes or else it will be saved as a text file. Now Safely remove your USB drive and plug back in, the icon and name should appear in Windows Explorer if your did everything right. You can also automatically launch an application. If this is not the way you prefer to work use this neat application to generate the autorun.inf file automatically

2. Add a Start Menu to your USB drive

portable appsDownload and install the Portable Apps Suite on your USB drive, it not only gives you a nice start menu for your USB drive but also gives you the ability to run some of the most popular applications (like Firefox, Putty, OpenOffice, SumatraPDF, notepad++ and many more) right from your USB drive. A must have for your USB drive

3. Use Mojopac

mojopacMojopac gives you your operating environment right on your USB drive. You can be rest assured that you will find a familiar interface with Mojopac on any pc you plug your USB drive into, all the customization will be preserved from computer to computer. Moreover it lets you operate without leaving any trace what so ever on the computer, so you can be rest assured about your privacy and data

4. Write Protect your Drive

My USB drive has a write protect notch that prevents it from being written onto when plugged on a computer, this is important because if the computer you are plugging into is infected than it can readily infect your USB drive. However if your drive cannot be write protected then you can use thumbscrew. It makes anything connected to the USB non writeable until you are sure and want to make it writeable.

5. Make Autorun.inf read only and system file

Thumbscrew may prevent writing on USB devices but it has to be already present on the computer you want to plug your USB drive into, so if its not possible for one reason or the other then you should make sure that you have a custom autorun.inf file and that its read only and has the system file attribute set. This prevents malicious code from writing entries to your autorun.inf and thus even if your USB drive may have a virus it won’t actually run it automatically. So a little bit more protection but not fool proof by any means.

6. Hold down the shift key

If you suspect your USB drive may be infected but still you have to plug it in to scan and remove the infections, then when you plug it in hold down the shift key to prevent autorun if its not already disabled.

7. Encrypt your drive using Truecrypt

true cryptYou can encrypt all the data on your USB drive using Truecrypt. This fives you added security if you have some sensitive data on your USB drive. Simply run it and choose your USB device to encrypt. TrueCrypt is free, Open Source and efficient and gives you extra security, download it here.

8. Sync your drive.

Microsoft offers an excellent application specially to address all your syncing needs. Its called the SyncToy. If you have to work on the same files on two different computers than you want to have the latest version of all files all the time, this can be easily done with synctoy. It offers both oneway and twoway synching. Its also free to download. Download it here

9. Backup your drive

toucanBacking up is always a nice thing to do, specially when you have to use it on different computers. There is a portable app to make this very easy. Its toucan, you can install it on your USB drive and back up, sync and encrypt your data as and when you want. Or else there is this the USB Image Tool that creates an image of everything you have on your drive and saves it as one file.

10. Make it bootable

pen drive linuxYou can install and run Linux from your USB thumb drive, this is an excellent way to recover systems that won’t boot, or to just plug it into another computer and do all of your work using linux applications and surf the net without leaving any history on the host computer. For this try pendrivelinux