>
> One of the features of GWT is its abstraction over the browser so that the 
> GWT-Java layout code may act differently depending on the browser brand and 
> version.  If we use GWT as a JavaScript replacement only, don't we lose 
> that benefit?
>

That benefit gets less and less important as HTML + CSS layout/styling is 
pretty consistent between browsers once you have adjusted the different 
default CSS styles of different browsers. So most of the time GWT helps you 
on JavaScript level (event handling, missing JS features in older browsers, 
etc) and not so much on HTML/CSS level. There are a few widgets that 
correct some stuff between browsers however every time GWT drops support 
for an old IE some of these fixes are not needed anymore up to a point 
where every widget is the same for each supported browser.

I am not saying you should not use widgets at all, especially if you 
support IE8,9 (because of possible memory leaks that GWT prevents), however 
there are quite some widgets that most of the time do nothing in your app 
except costing performance and memory. FlowPanel and InlineLabel/Label are 
probably used a lot in every app however most of the time they are just 
used to apply styles to them, grouping childs or are just read only labels. 
Most of the time you can replace them with HTML elements without 
sacrificing anything.

 

> Additionally, the argument of using HTML (UIBinder) over GWT layout code 
> is the argument of declarative (HTML) vs. imperative (GWT layout) 
> programming.  Surely most would agree that declarative models are faster 
> and easier in simple cases but have limits that can only be solved 
> imperatively.  Also, imperative utilities can often be built making the 
> imperative model nearly as fast and simple as declarative models.  Do you 
> agree?
>

Sure, you usually have a mixture of both in your app. Everything that can 
be defined declaratively will go into a UiBinder file and everything that 
has dynamic behavior will be solved imperatively using Java code. For 
example if you have a page with complex static design you can put that into 
the UiBinder file along with some placeholders for child widgets. Then you 
use Java to fill these placeholders dynamically depending on some 
conditions. 

Also UiBinder does not mean you must use HTML. It is just a declarative 
approach and allows you to quickly understand the structure of a view. 
However once you start using UiBinder you can effectively start using 
HTMLPanel (which is a bit of a pain when using it through pure java) which 
then allows you to mix HTML elements and GWT widgets and gain 
performance/memory improvements (because you can reduce the amount of 
widgets)

-- 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to