Saturday, December 14, 2013

Re: New article on using Cell Widgets for every day GWT development

The main advantage to me is that you are writing high performance widgets as a standard practice.  There are far fewer javascript calls to create these types of widgets. As your app gets larger it will continue to stay performant. 

I actually believe that you do not get that much of a performance benefit by using CellWidget unless someone proves the opposite and provides some decent benchmarking results. Here are my reasons:

1.) CellWidget extends Widget so you get the same Widget based overhead like with traditional widgets (e.g. set up widget event system)
2.) What makes CellTable/DataGrid/CellList really fast is that they are able to create one very large string of HTML code via Cell rendering and then call container.setInnerHTML(largeString) once. 
However with lots of CellWidgets you have lots of setInnerHTML calls and the HTML string for those CellWidgets is typically a lot smaller then what CellTable/DataGrid/CellList produce. For such a small HTML string I believe that setInnerHTML does not perform significant faster than a couple of DOM operations, especially if you are using UiBinder for your traditional Widget and using HTMLPanel as root widget so you can use as much HTML as possible inside UiBinder.
3.) A CellWidget needs to redraw itself every time its associated data changes. So you end up with even more setInnerHTML calls.

IMHO it's probably only worth it to use CellWidget if you need to support IE6/7 because its DOM performance is so bad. IE8 works kind of ok'ish if you don't add too many widgets at once but will probably also benefit from CellWidgets. Well and if you are lucky and must only support IE 9+ then CellWidget will definitely loose its value.

So please prove me wrong for IE 9+ browsers :)


Anyways what I like about the article is that it shows a compact example on how to use UiBinder + UiRenderer for writing cells (maybe adding one event handler for demonstration would have been a nice addition) and that you can re-use that cell in a widget context if you need to.


-- J.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate