Friday 14 June 2013

GWT project experience


Recently I had to create a full working ground up project using the Google Web Toolkit Framework, so I thought I would give my feedback on the experience I had working with it. Take note, that I have previously worked with ASP .NET, Django, Spring Framework thus I will mostly compare it to these.

As you may have noticed GWT is an open source development toolkit. The setup process of your very first working application is no longer than 5-10 minutes which is what I love about it. All you have to do is download the GWT plugin from the Eclipse Marketplace, restart Eclipse, right-click create new GWT project and check to generate sample code. The most basic application will be set up for you. Right click your project to run in DevMode and open a browser for you application. How great is that?

When you get over the fact of how easy it is to test your application and that all the things you need are already set up for you and you do not have to fiddle with web.xml or GWT libraries. Next step is to play around with some of the amazing features GWT offers by going to their Showcase web page where they offer a preview of how the certain widget looks like but also the code to get it to work.

One of the things that struck me as abnormal to the original way of developing web pages is the fact that GWT only needs 1 .html page. Everything inside this page is assigned dynamically using pure java code. In case you have a page full of buttons and you do not want to spend millions of lines of code declaring every single “Button button1 = new Button();” all you have to do is look up UiBinder where all of these widgets will be declared using a well structured xml document. Great huh?

I outlined how pretty and simple GWT makes dynamic web page creation, but with every view there is always a rant, so lets begin. GWT YOU ARE SO LIMITED! Sure all the widgets are great and all, but the amount of time I had to spend customising handlers and @Overriding these widgets to get them to do what I wanted is ridiculous. It was a constant battle of the wits. TextArea, a box for text, does NOT have a set for the maximum number of characters it accept. I had to create a javascript native method for pasting and a keyboard press handler to limit character input. Don’t even get me started on CellTable. I will make a tutorial at some point for the customisation of CellTable to your needs, mostly because I spent so much time at it that I do not want to waste it.

You might start asking me, “well, if you think GWT is so limited why not just download something like smartgwt or gxt which have many more features?” well sir, my answer to you is: did you see the size of the libraries for those things? I do not want to use all the features... Why can’t I make several simple parameter setups for the current GWT widgets instead?

Don’t get me wrong, GWT is fun and great, but it doesn’t teach you much about proper web development setup. If you are new and want to try something quick I would suggest GWT, if you have a more serious project and you want GWT go with GXT even though I see a lot of people complaining about its features breaking peoples applications.

TL;DR : With great power (like GWT), comes great programmability.




No comments:

Post a Comment